diff options
-rw-r--r-- | .github/actions/rn-pr-labeler-action/action.yml | 41 | ||||
-rw-r--r-- | .github/release.yml | 40 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | eos_downloader/object_downloader.py | 12 | ||||
-rw-r--r-- | pyproject.toml | 16 |
5 files changed, 97 insertions, 15 deletions
diff --git a/.github/actions/rn-pr-labeler-action/action.yml b/.github/actions/rn-pr-labeler-action/action.yml new file mode 100644 index 0000000..a685ffc --- /dev/null +++ b/.github/actions/rn-pr-labeler-action/action.yml @@ -0,0 +1,41 @@ +name: "rn-pr-labeler" +author: "@gmuloc" +description: "Parse a conventional commit compliant PR title and add it as a label to the PR with the prefix 'rn: '" +inputs: + auto_create_label: + description: "Boolean to indicate if the label should be auto created" + required: false + default: false +runs: + using: "composite" + steps: + - name: 'Looking up existing "rn:" label' + run: | + echo "OLD_LABEL=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q .labels[].name | grep 'rn: ')" >> $GITHUB_ENV + shell: bash + - name: 'Delete existing "rn:" label if found' + run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "${{ env.OLD_LABEL }}" + shell: bash + if: ${{ env.OLD_LABEL }} + - name: Set Label + # Using toJSON to support ' and " in commit messages + # https://stackoverflow.com/questions/73363167/github-actions-how-to-escape-characters-in-commit-message + run: echo "LABEL=$(echo ${{ toJSON(github.event.pull_request.title) }} | cut -d ':' -f 1 | tr -d ' ')" >> $GITHUB_ENV + shell: bash + # an alternative to verifying if the target label already exist is to + # create the label with --force in the next step, it will keep on changing + # the color of the label though so it may not be desirable. + - name: Check if label exist + run: | + EXIST=$(gh label list -L 100 --search "rn:" --json name -q '.[] | select(.name=="rn: ${{ env.LABEL }}").name') + echo "EXIST=$EXIST" >> $GITHUB_ENV + shell: bash + - name: Create Label if auto-create and label does not exist already + run: | + gh label create "rn: ${{ env.LABEL }}" + shell: bash + if: ${{ inputs.auto_create_label && ! env.EXIST }} + - name: Labelling PR + run: | + gh pr edit ${{ github.event.pull_request.number }} --add-label "rn: ${{ env.LABEL }}" + shell: bash diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..c807ddf --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,40 @@ +changelog: + exclude: + labels: + - 'rn: test' + - 'rn: ci' + categories: + - title: Breaking Changes + labels: + - 'rn: feat!' + - 'rn: feat(cli)!' + - 'rn: fix!' + - 'rn: fix(cli)!' + - 'rn: cut!' + - 'rn: cut(cli)!' + - 'rn: revert!' + - 'rn: revert(cli)!' + - 'rn: refactor!' + - 'rn: refactor(cli)!' + - 'rn: bump!' + - 'rn: bump(cli)!' + - 'rn: feat!' + - 'rn: fix!' + - 'rn: cut!' + - 'rn: revert!' + - 'rn: refactor!' + - 'rn: bump!' + - title: New features and enhancements + labels: + - 'rn: feat' + - 'rn: feat(cli)' + - title: Fixed issues + labels: + - 'rn: fix' + - 'rn: fix(cli)' + - title: Documentation + labels: + - 'rn: doc!' + - title: Other Changes + labels: + - '*' @@ -345,4 +345,5 @@ report.html *.swp arista.xml -tester.py
\ No newline at end of file +tester.py +*.tgz
\ No newline at end of file diff --git a/eos_downloader/object_downloader.py b/eos_downloader/object_downloader.py index c107fee..3a22312 100644 --- a/eos_downloader/object_downloader.py +++ b/eos_downloader/object_downloader.py @@ -494,12 +494,12 @@ class ObjectDownloader: hash_result = self._compute_hash_sh512sum( file=file_downloaded, hash_expected=hash_expected ) - if not hash_result: - logger.error("Downloaded file is corrupted, please check your connection") - console.print( - "❌ Downloaded file is corrupted, please check your connection" - ) - return False + if not hash_result: + logger.error("Downloaded file is corrupted, please check your connection") + console.print( + "❌ Downloaded file is corrupted, please check your connection" + ) + return False logger.info("Downloaded file is correct.") console.print("✅ Downloaded file is correct.") return True diff --git a/pyproject.toml b/pyproject.toml index b06934a..fbd2982 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "eos_downloader" -version = "v0.10.1" +version = "v0.10.2" readme = "README.md" authors = [{ name = "Thomas Grimonet", email = "thomas.grimonet@gmail.com" }] maintainers = [ @@ -22,11 +22,11 @@ dependencies = [ "scp", "tqdm", "loguru", - "rich>=13.5.2,<13.8.0", + "rich>=13.5.2", "cvprac>=1.0.7", - "click~=8.1.6", - "click-help-colors~=0.9", - "pydantic>2.0.0,<3.0.0", + "click>=8.1.6", + "click-help-colors>=0.9", + "pydantic>2.0.0", ] keywords = ["eos_downloader", "Arista", "eos", "cvp", "network", "automation", "networking", "devops", "netdevops"] classifiers = [ @@ -51,7 +51,7 @@ requires-python = ">=3.8" [project.optional-dependencies] dev = [ - "mypy==1.8.0", + "mypy==1.10.0", "isort==5.13.2", "mypy-extensions>=0.4.3", "pre-commit>=2.20.0", @@ -62,7 +62,7 @@ dev = [ "pytest-html>=3.1.1", "pytest-metadata>=1.11.0", "pylint-pydantic>=0.2.4", - "tox~=4.11", + "tox>=4.11", "types-PyYAML", "types-paramiko", "types-requests", @@ -94,7 +94,7 @@ namespaces = false # Version ################################ [tool.bumpver] -current_version = "0.10.1" +current_version = "0.10.2" version_pattern = "MAJOR.MINOR.PATCH" commit_message = "bump: Version {old_version} -> {new_version}" commit = true |