This library contains the functions and utilities that are shared by most Network Automation projects built at SURF.
To install the package from PyPI:
pip install nwa-stdlibSteps to setup a virtual environment.
Install uv and create the development environment:
uv sync --locked --group test --group devRun project commands through that environment with uv run, for example:
uv run pytestRun the unit tests through the uv-managed environment:
uv run pytestThis project uses prek, a fast drop-in replacement for pre-commit, to automatically run a number of checks before making a git commit. The same checks will be performed in the CI pipeline so this can save you some time.
prek is part of the dev dependency group, so it is available after uv sync.
Go into the project root and enable it:
uv run prek installThis should output prek installed at .git/hooks/pre-commit. The next time you run git commit the hooks will validate your changes.
To run the hooks manually on all files, use uv run prek run --all-files.
When a release version has been assigned, update the package metadata on a clean branch with uv version:
uv version 1.12.2Specify the full version explicitly so release candidates can be represented, for example uv version 1.12.2rc1.
nwa-stdlib must support the same python versions as orchestrator-core.
Exceptions to this rule are:
- A new python version is released: nwa-stdlib should support the new version before orchestrator-core does
- Support for an old python version is dropped: nwa-stdlib should drop the python version after orchestrator-core does