General | Running Tests | Make Docs | Build PyPi Package |
- Make sure pytest is installed in the virtual environment
pip install -U pytest
. - Currently all the tests are in the docstrings. Run them with the command
pytest --doctest-modules
.
- Make sure pdoc is installed and updated in the virtual environment
pip install -U pdoc
. - The main README is used as the first page of the documentation. Thus, all images must have full urls to web accessible images.
- At the root level run pdoc
pdoc --logo https://gutow.github.io/round_using_error/rnd_w_err.svg --logo-link https://gutow.github.io/round_using_error/ --footer-text "round_using_error vX.X.X" --math -html -o docs round_using_error
whereX.X.X
is the version number. - Edit the created
index.html
, if necessary, to point to an alternate homepage from the pdoc default.
- Make sure to update the version number in setup.py first.
- Install updated setuptools and twine in the virtual environment:
pipenv shell pip install -U setuptools wheel twine
- Build the distribution
python -m setup sdist bdist_wheel
. - Test it on
test.pypi.org
.- Upload it (you will need an account on test.pypi.org):
python -m twine upload --repository testpypi dist/*
. - Create a new virtual environment and test install into it:
There are often install issues because sometimes only older versions of some of the required packages are available on test.pypi.org. If this is the only problem change the version to end in
exit # to get out of the current environment cd <somewhere> mkdir <new virtual environment> cd <new directory> pipenv shell #creates the new environment and enters it. pip install -i https://test.pypi.org/..... # copy actual link from the # repository on test.pypi.
rc0
for release candidate and try it on the regular pypi.org as described below for releasing on PyPi. - After install test by running a jupyter notebook in the virtual environment.
- Upload it (you will need an account on test.pypi.org):
Proceed only if testing of the build is successful.
- Double check the version number in setup.py.
- Rebuild the release:
python -m setup sdist bdist_wheel
. - Upload it:
python -m twine upload dist/*
- Make sure it works by installing it in a clean virtual environment. This
is the same as on test.pypi.org except without
-i https://test.pypy...
. If it does not work, pull the release.