Distribution

This document contains some notes on distributing NASim via PyPi. This is mainly as a reminder for the steps to take when releasing an update.

Note

Unless specified otherwise, all bash commands are assumed to be executed from the root directory of the NASim package.

Before pushing to master

  1. Ensure all tests are passing by running:
cd test
pytest
  1. Ensure updates are included in the What’s new section of the README.rst and docs/source/index.rst files (this step can be ignored for very small changes)
  2. Ensure any necessary updates have been included in the documentation.
  3. Make sure the documentation can be built by running:
cd docs
make html
  1. Ensure setup.py has been updated to reflect any version and/or dependency changes.

After changes have been pushed

If pushing a new version (MAJOR, MINOR, or MICRO), do the following:

  1. Add a tag with the release number to the commit.
  2. On github create a new release and link it to the tagged commit
  3. Publish the new release to PyPi:
# build distributions
python setup.py sdist bdist_wheel

# upload latest distribution builds to pypi
# this will ask for PyPi username and password
python -m twine upload dist/* --skip-existing
  1. Login to https://pypi.org/ and verify latest version is added correctly.
  2. Visit https://networkattacksimulator.readthedocs.io/en/latest/index.html and check documentation has updated correctly (make sure to refresh browser cache to ensure your looking at the latest version.)