First of all, thank you for using and contributing to rics! Any and all contributions are welcome.
Issues are tracked on GitHub. Issue reports are appreciated, but please use a succinct title and add relevant tags. Please include a Minimal reproducible example if reporting an issue, or sample snippet if requesting a new feature or change which demonstrates the (desired) usage.
To be merged, all tests (including generating documentation), must be successful.
General requirements which applies to all code in the library.
These requirements are not verified in CI/CD.
User-facing changes should be recorded in the changelog.
Summarize the changes being made, and why they’re made.
Expensive operations (especially related to logging) should only be done if the result is needed.
Coverage exceptions should be minimal.
These requirements are verified in CI/CD.
Coverage must remain at 100% (after ignores).
Public methods and classes must be documented.
Use the commit hooks to format and lint the code.
Follow these steps to begin local development. I use Ubuntu LTS and PyCharm (both are kept updated), so such environments will usually work without too much trouble.
Installing Poetry and Invoke
Poetry is an alternative to tools like Pipenv.
curl -sSL https://install.python-poetry.org/ | python -
pip install invoke
Installing the project
Clone and install the virtual environment used for development. Some material is placed in submodules, so we need to clone recursively.
git clone --recurse-submodules git@github.com:rsundqvist/rics.git
cd rics
git submodule update --init --recursive
poetry install --all-extras --with=docs
Generating documentation has a few dependencies which may need to be installed manually.
sudo apt-get update
sudo apt-get install pandoc tree
Install commit hooks (optional)
If this step is skipped, use inv hooks to run hooks manually.
poetry run inv install-hooks
Verify installation (optional)
This is similar to what the CI/CD pipeline will run for a single OS and major
Python version. It also skips the additional isolation provided by nox,
which may hide some dependency-gotchas.
./run-docker-dvdrental.sh
./run-invocations.sh
Bonus content
poetry install --with=jupyter
Relying on GitHub actions for new CI/CD features is quite slow. An alternative is to use
act instead, which allows running pipelines locally (with some limitations, see act
docs). For example, running
act -j tests
will execute the tests workflow.
Originally created with Cookiecutter and the fedejaure/cookiecutter-modern-pypackage template. The repo has changed quite a lot since creation, but some linked resources linked are still useful.