The dependencies needed to contribute can be installed by
pip install .[dev]
flake8 is used to lint the code. The config is located in setup.cfg. Linting can be run using
flake8 .
black is used to format Python files. Most editors can be configured to format on save but you can run the formatting manually using
black .
mypy is used to check typing
statically. The config is located in pyproject.toml
. Type checking can be run
using
mypy
pytest is used to run the tests. The
config is located in pyproject.toml
. Tests can be run using:
python -m pytest
Note: This is different from calling pytest
, see
Invoking pytest versus python -m pytest.
The CI will check that the lint check passes, that all files are correctly
formatted (using black --check .
) and that tests passes. Before commiting, be
sure to run flake8
, black
, mypy
and python -m pytest
to ensure CI
passes.
Even if you do not have access to a Slurm cluster, it is possible to mock the
Slurm info to generate the spawn page for a local development JupyterHub
instance. For instance, see the
demo/jupyterhub_conf.py
file which which you can
use to start jupyterhub using jupyterhub_moss:
jupyterhub -f demo/jupyterhub_conf.py
From the project directory, run: python3 -m build
to generate the wheel and
tarball in dist/
First, be sure to be up to date with the remote main
and that your working
tree is clean. Then, run bumpversion
:
bumpversion [major|minor|patch]
This will bump the version, commit the result and tag the current HEAD. You can then push the commit and the tag to the repo:
git push && git push --tags
This will trigger a CI job that should release automatically the package on PyPI.