Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 2.53 KB

CONTRIBUTING.md

File metadata and controls

102 lines (70 loc) · 2.53 KB

Contributing to Mozilla Taskgraph

Thanks for your interest in mozilla-taskgraph! To participate in this community, please review our code of conduct.

Clone the Repo

To contribute to mozilla-taskgraph, you'll need to clone the repository:

# first fork mozilla-taskgraph
git clone https://github.com/<user>/mozilla-taskgraph
cd mozilla-taskgraph
git remote add upstream https://github.com/mozilla-releng/mozilla-taskgraph

Setting Up the Environment

We use a tool called uv to manage mozilla-taskgraph and its dependencies. First, follow the installation instructions.

Then run:

uv sync

This does several things:

  1. Creates a virtualenv for the project in a .venv directory (if necessary).
  2. Syncs the project's dependencies as pinned in uv.lock (if necessary).
  3. Installs mozilla-taskgraph as an editable package (if necessary).

Now you can prefix commands with uv run and they'll have access to this environment.

Running Tests

Tests are run with the pytest framework:

uv run pytest

Running Checks

Linters and formatters are run via pre-commit. To install the hooks, run:

pre-commit install -t pre-commit -t commit-msg

Now checks will automatically run on every commit. If you prefer to run checks manually, you can use:

pre-commit run

Most of the checks we enforce are done with ruff. See pre-commit-config.yaml for a full list of linters and formatters.

Releasing

A tool called commitizen can optionally be used to assist with releasing the package. First make sure it is installed.

Then create the version bump commit:

cz bump
git show

Verify the commit is what you expect, then create a pull request and get the commit merged into main. Once merged, push your tag upstream:

git push upstream --tags

Finally, create a release in Github, choosing the tag that you just pushed. This will trigger the pypi-publish workflow and upload the package to pypi.