Development¶
Linting¶
Install the development dependencies and set up the pre-commit hooks:
Running Tests¶
Run the unit and integration tests with:
Online tests exercise real data sources. You can store credentials in a .env file and
they will be loaded automatically by pytest-dotenv:
Several data source tests verify that the test runs correctly when certain
configuration options are non-local UPaths rather than local ones. These tests use
UPaths on Google Cloud Storage and depend on GCS access. To run them, the TEST_BUCKET
and TEST_PREFIX environment variables must be set, e.g.:
Building the Documentation Locally¶
The documentation site is built with MkDocs and the Material theme. Install the docs dependencies and serve the site locally with live reload, from the repository root:
Then open the printed URL (by default http://127.0.0.1:8000/rslearn/) in your browser.
The site rebuilds automatically as you edit files under docs/.
Releasing¶
Automated Release Machinery¶
This project uses GitHub Actions (publish.yml) to automatically build and publish to PyPI. The workflow triggers when a GitHub release is created.
The workflow:
- validates that the release tag version (v*) matches the version in pyproject.toml
- builds the distribution packages using uv build
- publishes to PyPI using trusted publishing
Releasing Workflow¶
- Confirm that the version in
pyproject.tomlmatches the semantic version you plan to release. Update this if necessary.- Consider using uv's version bump command to do this, since the project uses
uvand this command may flag any problems.
- Consider using uv's version bump command to do this, since the project uses
- If there are any changes, including a change to
pyproject.toml, open a pull request to merge those changes intomaster. - When that PR is merged, push a tag named
vX.Y.Zto the merge commit from your merged PR. - Use GitHub's web UI to create a release, selecting the tag you just pushed.
- The GitHub release you created should automatically trigger the
publishGitHub Action. Monitor that workflow to confirm success.- The workflow requires approval from a team member; if you cannot approve it yourself, contact someone who can.
- Verify the new version is available on PyPI.