This project builds upon the Scanpy developer guide, which provides extensive documentation for developers. This document summarizes the most important information to help you get started contributing to this project.
If you're unfamiliar with Git or making pull requests on GitHub, please refer to the Scanpy developer guide.
In addition to the packages required to use this package, you'll need additional Python packages to run tests.
The easiest way to manage dependencies is with Hatch environments. You can run the following commands:
hatch test # Defined in the [tool.hatch.envs.hatch-test] section of pyproject.tomlIf you prefer managing environments manually, you can use pip:
cd slurm_sweep
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,test]"This project uses pre-commit to enforce consistent code styles. On every commit, pre-commit checks will either automatically fix issues or raise an error message.
To enable pre-commit locally, run the following command in the root of the repository:
pre-commit installPre-commit will automatically download all dependencies when it is run for the first time.
Alternatively, you can rely on the pre-commit.ci service enabled on GitHub. If you didn't run pre-commit before pushing changes to GitHub, it will automatically commit fixes to your pull request or show an error message.
If pre-commit.ci adds a commit to a branch you're working on locally, use the following command to integrate the changes:
git pull --rebaseWhile pre-commit.ci is useful, we strongly encourage installing and running pre-commit locally to understand its usage.
Most editors support autoformat on save. Consider enabling this option for Ruff and Biome.
This project uses pytest for automated testing. Please write tests for every function added to the package.
hatch test # Test with the highest supported Python version
# or
hatch test --all # Test with all supported Python versionssource .venv/bin/activate
pytestContinuous integration automatically runs tests on all pull requests and tests against the minimum and maximum supported Python versions.
Additionally, a CI job tests against pre-releases of all dependencies (if available). This helps detect incompatibilities with new package versions early, giving you time to fix issues or reach out to the developers of the dependency before the package is widely released.
This package uses hatch-vcs to infer version numbers. Follow Semantic Versioning:
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version for incompatible API changes,
- MINOR version for backwards-compatible functionality additions, and
- PATCH version for backwards-compatible bug fixes.
Once updated, commit and push your changes. Navigate to the "Releases" page on GitHub, specify vX.X.X as the tag name, and create a release. For more details, see managing GitHub releases.
This will automatically create a Git tag and trigger a GitHub workflow to publish the release on PyPI.