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 changes

  • Bump the ciscoconfparse2 version number in ciscoconfparse2/__about__.py with hatch version micro or hatch version minor

  • Publish to github with make cicd

  • cd sphinx-doc and make 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 flags

    • Those #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

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