... 🚧 More will come soon ...
- Fork and Clone the repository.
- Install the package with dev-dependencies in an editable way
(from your local clone of the repository):
This will install:
pip install -e .[dev,plot]
pytest
andpytest-cov
for testing with coverage.black
andruff
for linting.mypy
for type-hinting.mkdocs
,mkdocstrings[python]
andmkdocs-material
for documentation generation.pre-commit
to add a pre-commit hook that includes:trailing-whitespace
andcheck-added-large-files
black
ruff
mypy
- Install the pre-commit hooks with
pre-commit install
After making changes to the code you can:
- (optional) run
pre-commit run --all-files
to manually run the pre-commit hooks. Otherwise, pre-commit is always run when committing a file. - Test the code with coverage by running
pytest
- To see the local docs in your browser, run
mkdocs serve
. Changes in the code and docs files will be automatically implemented.
- Make changes ready for deployment (on seperate branch)
- Modify Documentation according to the code changes.
Observe changes with
mkdocs serve
. - Run pre-commit (runs automatically when commiting)
- Bump version number in
pyproject.toml
andlorenzpy/__init__
- Test everything with
pytest
- Modify Documentation according to the code changes.
Observe changes with
- Create merge request. See if all GitHub actions pass. Merge.
- (Me) Pull code on
main
branch after MR. - (Me) Reinstall package in a fresh venv using
pip install -e .[dev,plot]
- (Me) Tag git? Create GH release?
- (Me) Upload to TestPyPI and PyPI and GH docs:
- Run
python -m pip install --upgrade build twine
- To build run
python -m build
- To upload to Test PyPI: run
python -m twine upload --repository testpypi dist/*
- Test the package installation from Test PyPI by running:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple lorenzpy
- Test the package installation from Test PyPI by running:
- To upload to PyPI run
twine upload dist/*
- Upload new docs by running:
mkdocs gh-deploy
- Run
Element | Resources |
---|---|
General Python Packaging | Python Packages E-book, Creating an open source Python project from scratch, PyPA Packaging Python Projects |
Documentation with MKdocs | Real Python Tutorial, Latex in MKdocs |
Other repos using setuptools with pyproject.toml |
modern-python-package, py-tiny-pkg |
Markdown | The Markdown Guide, GitHub Basic writing and formatting syntax |