diff options
-rw-r--r-- | .bumpversion.cfg | 24 | ||||
-rw-r--r-- | .github/dependabot.yml | 33 | ||||
-rw-r--r-- | .github/release.md | 102 | ||||
-rw-r--r-- | .github/workflows/pr-management.yml | 11 | ||||
-rw-r--r-- | .github/workflows/release.yml | 5 | ||||
-rw-r--r-- | CODE_OF_CONDUCT.md | 128 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | eos_downloader/models/version.py | 2 | ||||
-rw-r--r-- | pyproject.toml | 124 |
9 files changed, 333 insertions, 98 deletions
diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index 9562ed5..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,24 +0,0 @@ -[bumpversion] -commit = True -tag = False -tag_message = Bump version: {current_version} → {new_version} -tag_name = v{new_version} -current_version = 0.7.0 -parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([-](?P<release>(dev|rc))+(?P<build>\d+))? -serialize = - {major}.{minor}.{patch}-{release}{build} - {major}.{minor}.{patch} - -[bumpversion:part:release] -first_value = dev -optional_value = prod -values = - dev - prod - -[bumpversion:part:build] -first_value = 1 - -[bumpversion:file:./eos_downloader/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}' diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9695146..9394d8b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,26 +3,33 @@ # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# Basic set up for three package managers + version: 2 updates: - - package-ecosystem: "github-actions" + # Maintain dependencies for Python + # Dependabot supports updates to pyproject.toml files + # if they follow the PEP 621 standard. + - package-ecosystem: "pip" directory: "/" - labels: - - dependabot schedule: - interval: "weekly" + interval: "daily" + reviewers: + - "titom73" + labels: + - 'dependencies' + pull-request-branch-name: + separator: "/" commit-message: - prefix: "bump" - include: "ci" - open-pull-requests-limit: 10 - - package-ecosystem: "pip" + prefix: "bump: " + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" directory: "/" - labels: schedule: interval: "weekly" + reviewers: + - "titom73" labels: - - dependabot + - 'CI' commit-message: - prefix: "bump" - include: "requirements" - open-pull-requests-limit: 10 + prefix: "ci: " diff --git a/.github/release.md b/.github/release.md new file mode 100644 index 0000000..d95694d --- /dev/null +++ b/.github/release.md @@ -0,0 +1,102 @@ +# Notes + +Notes regarding how to release eos-downloader package + +## Package requirements + +- `bumpver` +- `build` +- `twine` + +Also, [Github CLI](https://cli.github.com/) can be helpful and is recommended + +## Bumping version + +In a branch specific for this, use the `bumpver` tool. +It is configured to update: +* pyproject.toml + +For instance to bump a patch version: +``` +bumpver update --patch +``` + +and for a minor version + +``` +bumpver update --minor +``` + +Tip: It is possible to check what the changes would be using `--dry` + +``` +bumpver update --minor --dry +``` + +## Creating release on Github + +Create the release on Github with the appropriate tag `vx.x.x` + +## Release version `x.x.x` + +> [!IMPORTANT] +> TODO - make this a github workflow + +`x.x.x` is the version to be released + +This is to be executed at the top of the repo + +1. Checkout the latest version of `main` with the correct tag for the release +2. Create a new branch for release + + ```bash + git switch -c rel/vx.x.x + ``` +3. [Optional] Clean dist if required + +4. Build the package locally + + ```bash + python -m build + ``` +5. Check the package with `twine` (replace with your vesion) + + ```bash + twine check dist/* + ``` +6. Upload the package to test.pypi + + ```bash + twine upload -r testpypi dist/eos-downloader-x.x.x.* + ``` +7. Verify the package by installing it in a local venv and checking it installs + and run correctly (run the tests) + + ```bash + # In a brand new venv + pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --no-cache eos-downloader + ``` +8. Push to eos-downloader repository and create a Pull Request + + ```bash + git push origin HEAD + gh pr create --title 'bump: eos-downloader vx.x.x' + ``` +9. Merge PR after review and wait for [workflow](https://github.com/titom73/eos-downloader/blob/main/.github/workflows/release.yml) to be executed. + + ```bash + gh pr merge --squash + ``` + +10. Like 7 but for normal pypi + + ```bash + # In a brand new venv + pip install eos-downloader + ``` + +11. Test installed version + + ```bash + eos-downloader --version + ```
\ No newline at end of file diff --git a/.github/workflows/pr-management.yml b/.github/workflows/pr-management.yml index 508a870..233166e 100644 --- a/.github/workflows/pr-management.yml +++ b/.github/workflows/pr-management.yml @@ -4,7 +4,7 @@ on: push: branches: - main - pull_request_target: + pull_request: types: [assigned, opened, synchronize, reopened] jobs: @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -93,7 +93,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} @@ -101,4 +101,5 @@ jobs: run: pip install tox tox-gh-actions - name: "Run tox for ${{ matrix.python }}" - run: tox -e testenv + # run: tox -e testenv + run: tox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 70cce9c..622a85d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: + images: | ${{ secrets.DOCKER_IMAGE }} ghcr.io/${{ secrets.DOCKER_IMAGE }} tags: | @@ -106,7 +106,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: + images: | ${{ secrets.DOCKER_IMAGE }} ghcr.io/${{ secrets.DOCKER_IMAGE }} tags: | @@ -134,3 +134,4 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..2b7d3c4 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,128 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +contact@inetsix.net. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. @@ -1,4 +1,4 @@ - [![code-testing](https://github.com/titom73/eos-downloader/actions/workflows/pr-management.yml/badge.svg?event=push)](https://github.com/titom73/eos-downloader/actions/workflows/pr-management.yml) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eos-downloader) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/titom73/arista-downloader) ![PyPI - Downloads/month](https://img.shields.io/pypi/dm/eos-downloader) ![Docker Image Size (tag)](https://img.shields.io/docker/image-size/titom73/eos-downloader/edge) + [![code-testing](https://github.com/titom73/eos-downloader/actions/workflows/pr-management.yml/badge.svg?event=push)](https://github.com/titom73/eos-downloader/actions/workflows/pr-management.yml) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/eos-downloader) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/titom73/arista-downloader) ![PyPI - Downloads/month](https://img.shields.io/pypi/dm/eos-downloader) # Arista Software Downloader diff --git a/eos_downloader/models/version.py b/eos_downloader/models/version.py index 14448c1..4b051a5 100644 --- a/eos_downloader/models/version.py +++ b/eos_downloader/models/version.py @@ -63,7 +63,7 @@ class EosVersion(BaseModel): minor: int = 0 patch: int = 0 rtype: Optional[str] = 'F' - other: Any + other: Any = None @classmethod def from_str(cls, eos_version: str) -> EosVersion: diff --git a/pyproject.toml b/pyproject.toml index 2b510e3..1fa01f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "eos_downloader" -version = "v0.8.1-dev1" +version = "v0.8.2" readme = "README.md" authors = [{ name = "Thomas Grimonet", email = "thomas.grimonet@gmail.com" }] maintainers = [ @@ -15,61 +15,62 @@ maintainers = [ description = "Arista EOS/CVP downloader script" license = { file = "LICENSE" } dependencies = [ -"cryptography", -"paramiko", -"requests>=2.20.0", -"requests-toolbelt", -"scp", -"tqdm", -"loguru", -"rich==12.0.1", -"cvprac>=1.0.7", -"click==8.1.3", -"click-help-colors==0.9.1", -"pydantic==1.10.4", + "cryptography", + "paramiko", + "requests>=2.20.0", + "requests-toolbelt", + "scp", + "tqdm", + "loguru", + "rich~=13.5.2", + "cvprac>=1.0.7", + "click~=8.1.6", + "click-help-colors~=0.9", + "pydantic>2.0.0,<3.0.0", ] keywords = ["eos_downloader", "Arista", "eos", "cvp", "network", "automation", "networking", "devops", "netdevops"] classifiers = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Intended Audience :: Information Technology', - 'Topic :: System :: Software Distribution', - 'Topic :: Terminals', - 'Topic :: Utilities', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: Implementation :: PyPy', + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Intended Audience :: Information Technology', + 'Topic :: System :: Software Distribution', + 'Topic :: Terminals', + 'Topic :: Utilities', + 'License :: OSI Approved :: Apache Software License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: Implementation :: PyPy', ] requires-python = ">=3.8" [project.optional-dependencies] dev = [ -"isort==5.12.0", -"mypy==0.991", -"mypy-extensions>=0.4.3", -"pre-commit>=2.20.0", -"pylint", -"pytest>=7.1.2", -"pytest-cov>=2.11.1", -"pytest-dependency", -"pytest-html>=3.1.1", -"pytest-metadata>=1.11.0", -"pylint-pydantic>=0.1.4", -"tox==4.0.11", -"types-PyYAML", -"types-paramiko", -"types-requests", -"typing-extensions", -"yamllint", -"flake8==4.0.1", -"pyflakes==2.4.0" + "isort==5.12.0", + "mypy==1.5.1", + "mypy-extensions>=0.4.3", + "pre-commit>=2.20.0", + "pylint", + "pytest>=7.1.2", + "pytest-cov>=2.11.1", + "pytest-dependency", + "pytest-html>=3.1.1", + "pytest-metadata>=1.11.0", + "pylint-pydantic>=0.2.4", + "tox==4.10.0", + "types-PyYAML", + "types-paramiko", + "types-requests", + "typing-extensions", + "yamllint", + "flake8>=4.0.1", + "pyflakes>=2.4.0", + "bumpver>=2023.1126" ] [project.urls] @@ -81,10 +82,29 @@ Contributing = "https://www.github.com/titom73/eos-downloader" ardl = "eos_downloader.cli.cli:cli" lard = "eos_downloader.cli.cli:cli" +################################ +# Tools +################################ + [tool.setuptools.packages.find] include = ["eos_downloader*"] namespaces = false +################################ +# Version +################################ +[tool.bumpver] +current_version = "0.8.2" +version_pattern = "MAJOR.MINOR.PATCH" +commit_message = "bump: Version {old_version} -> {new_version}" +commit = true +# No tag +tag = false +push = false + +[tool.bumpver.file_patterns] +"pyproject.toml" = ['current_version = "{version}"', 'version = "v{version}"'] + # mypy as per https://pydantic-docs.helpmanual.io/mypy_plugin/#enabling-the-plugin [tool.mypy] plugins = [ @@ -120,8 +140,8 @@ min_version = 4.0 envlist = clean, lint, - type - + type, + py{38,39,310} [tox-full] min_version = 4.0 @@ -132,13 +152,13 @@ envlist = type, report -[gh-actions] +[gh-actions-base] python = 3.8: lint, type 3.9: lint, type 3.10: lint, type -[gh-actions-full] +[gh-actions] python = 3.8: py38 3.9: py39 |