Clone the repository:
git clone https://github.com/crate/crate-python cd crate-python
Setup a virtualenv and install the package:
python -m venv .venv source .venv/bin/activate python -m pip install --group dev --group docs -e .
Or if using uv:
uv venv .venv source .venv/bin/activate uv pip install --group dev --group docs -e .
Ensure the virtualenv is active and run tests using pytest:
python -m pytest
See also:
- How to invoke pytest <https://docs.pytest.org/en/stable/how-to/usage.html> for more information.
Use `ruff`_ for code formatting and linting:
ruff format --check . ruff check .
Use mypy for type checking:
mypy
For conducting TLS connectivity tests, there are a few X.509 certificates at tests/assets/pki/*.pem. In order to renew them, follow the instructions within the README file in this folder.
To create a new release, you must:
- Backport your bug fixes to the latest stable branch x.y (e.g. 0.19)
- For new features, create a new stable branch x.(y+1) (e.g. 0.20)
In the release branch:
- Add a section for the new version in the
CHANGES.rstfile - Commit your changes with a message like "Release x.y.z"
- Push to origin/<release_branch>
- Create a tag by running
git tag -s <version>and push itgit push --tags. This will trigger a Github action which releases the new version to PyPI. - Announce the new release on the GitHub Releases page.
On branch main:
- Update the release notes to reflect the release
Next:
- Archive docs for old releases (see section below)
Check the versions hosted on ReadTheDocs.
We should only be hosting the docs for latest, stable, and the most recent patch versions for the last two minor releases.
To make changes to the RTD configuration (e.g., to activate or deactivate a release version), please contact the @crate/docs team.
The docs live under the docs directory.
The docs are written with ReStructuredText and processed with Sphinx.
Build the docs by running:
./bin/sphinx
The output can then be found in the out/html directory.
The docs are automatically built from Git by Read the Docs and there is nothing special you need to do to get the live docs to update.