https://github.com/workfloworchestrator/nwa-stdlib
This repository contains some utility functions for the workflow orchestrator project.
https://github.com/workfloworchestrator/nwa-stdlib
python
Last synced: 11 months ago
JSON representation
This repository contains some utility functions for the workflow orchestrator project.
- Host: GitHub
- URL: https://github.com/workfloworchestrator/nwa-stdlib
- Owner: workfloworchestrator
- License: apache-2.0
- Created: 2020-10-09T06:48:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-17T10:39:41.000Z (about 1 year ago)
- Last Synced: 2025-06-16T03:15:25.226Z (about 1 year ago)
- Topics: python
- Language: Python
- Homepage:
- Size: 405 KB
- Stars: 2
- Watchers: 17
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Network Automation Standard Library
[](https://pypi.org/project/nwa-stdlib)
[](https://pypi.org/project/nwa-stdlib)
[](https://codecov.io/github/workfloworchestrator/nwa-stdlib)
This library contains the functions and utilities that are shared by most Network Automation projects built at SURF.
## Installation
To install the package from PyPI:
```bash
pip install nwa-stdlib
```
## Development
### Virtual Environment
Steps to setup a virtual environment.
#### Step 1:
Create and activate a python3 virtualenv.
#### Step 2:
Install flit to enable you to develop on this repository:
```bash
pip install flit
```
#### Step 3:
To install all development dependencies:
```bash
flit install --deps develop
```
All steps combined into 1 command:
```bash
python -m venv .venv && source .venv/bin/activate && pip install -U pip && pip install flit && flit install --deps develop
```
### Unit tests
Activate the virtualenv and run the unit tests with:
```bash
pytest
```
### Pre-commit
This project uses [pre-commit](https://pre-commit.com/) 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.
First ensure you have pre-commit installed.
It is recommended to install it outside the virtualenv.
On Linux and Mac, pre-commit is available in most package managers. Alternatively you can install it globally with [pipx](https://github.com/pypa/pipx).
Once pre-commit is installed, go into the project root and enable it:
```bash
pre-commit install
```
This should output `pre-commit installed at .git/hooks/pre-commit`. The next time you run `git commit` the pre-commit hooks will validate your changes.
### Bump version
Depending on the feature type, run bumpversion (patch|minor|major) to increment the version you are working on. For
example to update the increment the patch version use
```bash
bumpversion patch
```
## Supported Python versions
nwa-stdlib must support the same python versions as [orchestrator-core](https://github.com/workfloworchestrator/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