Contributing
Thanks for helping us make Bitmapist work better! Contributions are welcome, whether it's reporting an issue, submitting a pull request, or improving documentation.
Feel free to report any issue you may have.
Working on your first Pull Request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
Setting Up the Development Environment
We use uv for dependency management and pre-commit for code quality.
-
Clone the repository:
git clone https://github.com/Doist/bitmapist.git cd bitmapist -
Install
uv: Follow the officialuvinstallation instructions. -
Create a virtual environment and install dependencies: This command will install all production and development dependencies listed in
pyproject.toml.uv sync --all-extras --dev -
Install pre-commit hooks: This will run linters and formatters before each commit to ensure code consistency.
uv run pre-commit install
Running Tests
Our test suite uses pytest and requires a running Redis server.
-
Ensure Redis is installed and running. The test suite will attempt to start its own Redis instance. You can control this with environment variables:
BITMAPIST_REDIS_SERVER_PATH: Path to theredis-serverexecutable (defaults to one found inPATHor/usr/bin/redis-server).BITMAPIST_REDIS_PORT: Port for the test Redis server (defaults to6399).
-
Run the test suite:
uv run pytest
Submitting Changes
When you are ready to contribute code, please open a Pull Request. Keep the following in mind:
- The project is released under the BSD-3-Clause license.
- Please add tests for your changes! All new features should be accompanied by tests.
- Please document any user-facing changes using the Keep a Changelog convention. Changes in a PR should be documented under an
[Unreleased]version.
Releasing New Versions
This process is handled by maintainers.
-
Bump the version in
pyproject.tomlusinguv:uv version --bump minor -
Update the CHANGELOG with the release date and summary of changes.
-
Commit the changes with the message
Version X.X.X:git commit -m "Version $(uv version --short)" -
Tag the commit with
vX.X.X:git tag -a -m "Release $(uv version --short)" "v$(uv version --short)" -
Push the commit and tags to the
mainbranch. - Create a new release on GitHub named
vX.X.Xbased on the new tag. - The GitHub Actions workflow will automatically build and publish the new version to PyPI.