| 1 | <!-- |
| 2 | ~ Copyright (c) 2026 Arista Networks, Inc. |
| 3 | ~ Use of this source code is governed by the Apache License 2.0 |
| 4 | ~ that can be found in the LICENSE file. |
| 5 | --> |
| 6 | |
| 7 | # Notes |
| 8 | |
| 9 | Notes regarding how to release anta package |
| 10 | |
| 11 | ## Package requirements |
| 12 | |
| 13 | - `bumpver` |
| 14 | |
| 15 | Also, [Github CLI](https://cli.github.com/) can be helpful and is recommended |
| 16 | |
| 17 | ## Bumping version |
| 18 | |
| 19 | In a branch specific for this, use the `bumpver` tool. |
| 20 | It is configured to update: |
| 21 | |
| 22 | - pyproject.toml |
| 23 | - docs/contribution.md |
| 24 | - docs/requirements-and-installation.md |
| 25 | |
| 26 | For instance to bump a patch version: |
| 27 | |
| 28 | ```bash |
| 29 | bumpver update --patch |
| 30 | ``` |
| 31 | |
| 32 | and for a minor version |
| 33 | |
| 34 | ```bash |
| 35 | bumpver update --minor |
| 36 | ``` |
| 37 | |
| 38 | Tip: It is possible to check what the changes would be using `--dry` |
| 39 | |
| 40 | ```bash |
| 41 | bumpver update --minor --dry |
| 42 | ``` |
| 43 | |
| 44 | ## Creating release on Github |
| 45 | |
| 46 | Create the release on Github with the appropriate tag `vx.x.x` |
| 47 | |
| 48 | ## Release version `x.x.x` |
| 49 | |
| 50 | `x.x.x` is the version to be released |
| 51 | |
| 52 | When publishing a version the workflow `release.yml` is run. |
| 53 | |
| 54 | The workflow works as follow: |
| 55 | |
| 56 | 1. First build the wheel and the sdist for the package. |
| 57 | 2. Release to test pypi using trusted publisher (it needs to be approved in GitHub UI). |
| 58 | 3. Download the wheel from test pypi and run the tests by checking them out (testing on Linux, OSX and Windows). |
| 59 | 4. Release to Pypi (it needs to be approved in Github UI). |
| 60 | 5. Build and publish the doc. |
| 61 | 6. Publish docker containers. |
| 62 | |
| 63 | ### Tips |
| 64 | |
| 65 | #### Install from test pypi to run local tests between steps 2 and 4 |
| 66 | |
| 67 | ```bash |
| 68 | # In a brand new venv |
| 69 | pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --no-cache anta[cli] |
| 70 | ``` |