Build and Development
I recommend that you use hatch
to build and manage the package versions.
Typical development workflow looks like this:
git clone this repo
make changes
git commit your code changes
hatch run pytest
Edit
CHANGES.md
with your changesBump the
ciscoconfparse2
version number inciscoconfparse2/__about__.py
withhatch version micro
orhatch version minor
Publish to github with
make cicd
cd sphinx-doc
andmake html
publish documentation changes
Unit-Tests and SonarCloud
We are manually disabling some SonarCloud alerts with:
#pragma warning disable S1313
#pragma warning restore S1313
Where
S1313
is a False-positive that SonarCloud flagsThose
#pragma warning
lines should be carefully-fenced to ensure that we don’t disable a SonarCloud alert that is useful.
Semantic Versioning and Conventional Commits
At this point, ciscoconfparse2 does NOT adhere to Semantic Versioning
Although we added commitizen as a dev dependency, we are NOT enforcing commit rules (such as Conventional Commits) yet.
Execute Unit tests
The project’s test workflow checks ciscoconfparse2 on Python versions 3.7 and higher, as well as a pypy JIT executable.
If you already git cloned the repo and want to manually run tests either run with make test
from the base directory, or manually run with pytest
in a unix-like system…
$ cd tests
$ pytest ./test*py
...
Execute Test Coverage Line-Miss Report
If you already have have pytest
and pytest-cov
installed, run a test line miss report as shown below.
$ # Install the latest ciscoconfparse2
$ # (assuming the latest code is on pypi)
$ pip install -U ciscoconfparse2
$ pip install -U pytest-cov