Skip to content

Contributing

We follow Github flow in the development.

The basic procedure to contribute code to the project is:

  1. Install from cloned repository
  2. Create your own branch and implement the changes (and tests, preferably)
  3. Make sure the tests pass
  4. Create a pull request on Github
  5. Another contributor reviews the pull request
  6. Fix review comments if any
  7. Reviewer merges the pull request

Install from cloned repository

Clone repository to your local files:

git clone git@github.com:UEF-SmartSleepLab/sleeplab-format.git

This project uses Hatch for project management. First, install hatch. You will also need a recent version of pip.

Then, go to the root of the cloned repository and create an environment for it:

hatch env create

After that, you can enter the environment by:

hatch shell

You can confirm that the project has been installed by:

pip show sleeplab-format

Running tests

This project uses pytest for testing. To run the tests after cloning and installing, go to the root of the cloned repository and run:

pytest

Documenting the source code

The source code should be documented using Google style docstrings.

Generating the documentation

This documentation is created using Material for MkDocs and mkdocstrings. The documentation is published using Github Pages. There are utility scripts defined in pyproject.toml to build and publish the documentation.

When working on documentation, use hatch environment docs:

hatch -e docs shell

Build the documentation:

hatch run docs:build

Serve the documentation on local machine for inspection:

hatch run docs:serve

Publish the documentation:

hatch run docs:publish

Publishing to Zenodo

Whenever a new release is created in Github, the version will automatically be published in Zenodo.

Publishing to PyPI

First, remember to update the version in version.py. Then, follow Hatch publishing instructions.

Build the package with hatch:

hatch build

Then, publish to TestPyPI with:

hatch publish -r test

If the TestPyPI package is OK, publish to PyPI with:

hatch publish

Use token authentication with PyPI.