You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/development-infrastructure/python-dependencies.mdx
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,23 +14,24 @@ data if they turn out to be malicious.
14
14
15
15
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.
16
16
17
-
To add or manually update a dependency:
17
+
To add or update a dependency:
18
18
19
19
1. Clone https://github.com/getsentry/pypi/.
20
20
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).
21
21
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).
22
22
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.
25
32
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.
26
33
8. Merge your PR, pull `master`, and run `devenv sync`.
27
34
28
-
To update a dependency using GitHub Actions:
29
-
30
-
1. Go to https://github.com/getsentry/sentry/actions/workflows/bump-version.yml.
0 commit comments