Getting Started¶
This page walks you through setting up a development environment for TanagerSpec, running the common development tasks, and contributing changes back to the package.
Once you understand the workflow here, read the Architecture and Source Layout pages to learn how the package is structured and where new code should live.
Setting up the development environment¶
This package uses uv for dependency management and virtual environment handling.
Clone the repository:
Install uv (if it is not already installed on your system):
Create a virtual environment and install all developer dependencies:
You are now ready to start developing TanagerSpec.
Common development tasks¶
Running tests¶
Run the test suite with:
Linting and formatting¶
Check code style with Ruff:
Format the code with Ruff:
Building and serving documentation¶
Install the documentation dependencies and preview the site locally:
Build the static HTML documentation:
Adding and updating dependencies¶
Add a new runtime dependency:
Add a development dependency:
Running Jupyter notebooks¶
Jupyter notebooks are a great way to explore and prototype new features. Launch JupyterLab inside your development environment with:
Proposing changes¶
With your environment set up, you are ready to contribute changes to the package.
Creating a new branch¶
Before starting new work, make sure you have the latest version of the source:
Then create a new branch with a name of your choice:
Making changes¶
Modify the source files as needed. When you are happy with a change, commit it to your local repository:
When adding a feature, follow the guidance in Source Layout on where to implement it and how to expose it through a namespace.
Running tests and formatting checks¶
Before submitting, make sure all tests pass and the code is properly formatted:
Submitting a merge request¶
Finally, push your branch to the upstream repository:
Visit the source code repository after pushing. You should see a button to open a merge request, click it and submit.
Contribution guidelines¶
When contributing, please follow these guidelines:
- Follow PEP 8 and use type hints where possible.
- Add or update tests for new features and bug fixes (see
tests/, with HDF5 fixtures intests/data/tanager/). - Update the documentation as needed, including the API Reference for any user-visible API changes.