Skip to content

Commit 638c697

Browse files
authored
dev: update python dependency instructions (#14656)
1 parent 80896fc commit 638c697

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

develop-docs/development-infrastructure/python-dependencies.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,24 @@ data if they turn out to be malicious.
1414

1515
Any new dependency needs to be thoroughly reviewed and approved by [owners-python-build](https://github.com/orgs/getsentry/teams/owners-python-build/members). This group is already automatically tagged in your PR to `sentry` or `getsentry` as soon as you edit relevant files. For other repos you might need to do it manually.
1616

17-
To add or manually update a dependency:
17+
To add or update a dependency:
1818

1919
1. Clone https://github.com/getsentry/pypi/.
2020
2. `cd` into your clone and run `python3 -m add_pkg PKGNAME` (or `python3 -m add_pkg PKGNAME==PKGVERSION` if you want a version other than the latest).
2121
3. Commit the resulting changes to a branch, open a PR in `getsentry/pypi`, and tag someone on your team (any engineer can approve PRs on this repo).
2222
4. Once your PR is merged, go back to the main repo whose dependencies you want to change (`sentry`, `getsentry`, etc.).
23-
5. In that repo, add to or update `requirements-base.txt` or `requirements-dev.txt`, as appropriate. Note that many of our dependencies are pinned with lower bounds only, to encourage updating to latest versions, though we do use exact pins for certain core dependencies like `django`. Choose whichever one feels most appropriate in your case.
24-
6. Run `make freeze-requirements`. You might need to wait a few minutes for the changes to `getsentry/pypi` to be deployed before this will work without erroring.
23+
5. In that repo, add to or update the dependency in `pyproject.toml`.
24+
- In sentry, you can do this with the [bump-version action](https://github.com/getsentry/sentry/actions/workflows/bump-version.yml).
25+
- Click the **Run workflow** dropdown.
26+
- Fill in your package name and version.
27+
- Click the **Run workflow** button.
28+
- Some projects are still using `requirements*.txt`, in which case update those files.
29+
- The eventual goal is that every python project will [use `uv` to lock python dependencies](https://www.notion.so/Standard-Spec-python-uv-2248b10e4b5d8045b8fff30f8b8b67ca).
30+
- Note that dependencies should pinned with lower bounds only, to encourage updating to latest versions.
31+
6. Run `make freeze-requirements` (or `uv lock`). You might need to wait a few minutes for the changes to `getsentry/pypi` to be deployed before this will work without erroring.
2532
7. Commit your changes (which should consist of changes to both one of the `requirements` files and its corresponding lockfile) to a branch and open a PR in the relevant repo. If it's not obvious, explain why you're adding or updating the dependency. Tag `owners-python-build` if they haven't already been auto-tagged.
2633
8. Merge your PR, pull `master`, and run `devenv sync`.
2734

28-
To update a dependency using GitHub Actions:
29-
30-
1. Go to https://github.com/getsentry/sentry/actions/workflows/bump-version.yml.
31-
2. Click the **Run workflow** dropdown.
32-
3. Fill in your package name and version.
33-
4. Click the **Run workflow** button.
3435

3536
## Depending on forks
3637

0 commit comments

Comments
 (0)