Development
This guide will help you set up your development environment and contribute to the project.
Setting Up Development Environment
Clone the repository:
git clone https://github.com/argearriojas/singlecell-cookbook.git cd singlecell-cookbook
Create the development environment:
Using venv:
python -m venv .venv source .venv/bin/activate pip install -e ".[dev]"
Using conda:
conda env create --file environment.yml conda activate singlecell-cookbook
Code Style and Formatting
This project uses Ruff for code formatting and linting. The configuration is in ruff.toml,
which specifies:
Line length of 88 characters
Double quotes for strings
4-space indentation
Other Python code style rules
Editor Setup
While you can use any editor, here are the minimal recommended settings for popular editors:
VSCode
Install the Ruff extension
Configure formatting:
{ "[python]": { "editor.formatOnSave": true, "editor.defaultFormatter": "charliermarsh.ruff", "editor.codeActionsOnSave": { "source.fixAll": "explicit", "source.organizeImports": "explicit" } } }
PyCharm
Install the Ruff plugin
Enable “Format on Save”
Set Ruff as the default formatter
Running Tests
To run the tests:
pytest tests/
Version Management
This project uses bump2version for version management. To bump the version:
For a patch release (bug fixes):
bump2version patchFor a minor release (new features, backwards compatible):
bump2version minorFor a major release (breaking changes):
bump2version major
This will: - Update version numbers in all configured files - Create a git commit with the version change - Create a git tag for the new version
Building Documentation
To build the documentation:
cd docs
make html
The built documentation will be in docs/build/html.