-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use commitizen to aid with releases
- Loading branch information
Showing
3 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
Contributing to Simple Github | ||
============================= | ||
|
||
Thanks for your interest in simple-github! To participate in this community, please | ||
review our [code of conduct][0]. | ||
|
||
[0]: https://github.com/taskcluster/taskgraph/blob/main/CODE_OF_CONDUCT.md | ||
|
||
Clone the Repo | ||
-------------- | ||
|
||
To contribute to simple-github, you'll need to clone the repository: | ||
|
||
``` | ||
# first fork taskgraph | ||
git clone https://github.com/<user>/simple-github | ||
cd simple-github | ||
git remote add upstream https://github.com/mozilla-releng/simple-github | ||
``` | ||
|
||
Setting Up the Environment | ||
-------------------------- | ||
|
||
We use a tool called [uv][1] to manage Taskgraph and its dependencies. First, | ||
follow the [installation instructions][2]. | ||
|
||
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 ``simple-github`` as an editable package (if necessary). | ||
|
||
Now you can prefix commands with `uv run` and they'll have access to this | ||
environment. | ||
|
||
[1]: https://docs.astral.sh/uv/ | ||
[2]: https://docs.astral.sh/uv/getting-started/installation/ | ||
|
||
Running Tests | ||
------------- | ||
|
||
Tests are run with the [pytest][3] framework: | ||
|
||
``` | ||
uv run pytest | ||
``` | ||
|
||
[3]: https://docs.pytest.org | ||
|
||
Running Checks | ||
-------------- | ||
|
||
Linters and formatters are run via [pre-commit][4]. 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][5]. See | ||
[pre-commit-config.yaml][6] for a full list of linters and formatters. | ||
|
||
[4]: https://pre-commit.com/ | ||
[5]: https://docs.astral.sh/ruff/ | ||
[6]: https://github.com/taskcluster/taskgraph/blob/main/.pre-commit-config.yaml | ||
|
||
Releasing | ||
--------- | ||
|
||
A tool called [commitizen][7] can be used to assist with releasing the package. First | ||
install it with: | ||
|
||
``` | ||
uv tool install commitizen | ||
``` | ||
|
||
Then create the version bump commit: | ||
|
||
``` | ||
cz changelog | ||
cz bump | ||
git show | ||
``` | ||
|
||
Create a pull request and get the commit merged into `main`. Once merged, make sure | ||
your tag is pushed 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters