Skip to content

Commit f9d9d8f

Browse files
asottile-sentryJoshFerge
authored andcommitted
sentry fork
1 parent 35e4c96 commit f9d9d8f

File tree

7 files changed

+303
-307
lines changed

7 files changed

+303
-307
lines changed

.craft.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
minVersion: 0.34.0
2+
targets:
3+
- name: pypi
4+
- name: github
5+
- name: sentry-pypi
6+
internalPypiRepo: getsentry/pypi

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: build
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main, release/**, test-me-*]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.x
16+
- run: |
17+
set -x
18+
pip install build
19+
python -m build
20+
# TODO: we don't yet need an ext fork
21+
# cd ext
22+
# python -m build --outdir ../dist
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
name: ${{ github.sha }}
26+
path: dist/*

.github/workflows/release.yml

Lines changed: 23 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,34 @@
11
name: Release
22

33
on:
4-
release:
5-
types: [published]
6-
7-
concurrency:
8-
group: release-${{ github.event.release.tag_name }}
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: Version to release
8+
required: true
9+
merge_target:
10+
description: Target branch to merge into. Uses the default branch as a fallback (optional)
11+
required: true
912

1013
jobs:
11-
build-and-publish-ext:
14+
release:
1215
runs-on: ubuntu-latest
13-
environment:
14-
name: release-ext
15-
url: https://pypi.org/p/django-stubs-ext
16-
permissions:
17-
id-token: write
16+
name: "Release a new version"
1817
steps:
19-
- name: Install uv & Python
20-
uses: astral-sh/setup-uv@v7
18+
- name: Get auth token
19+
id: token
20+
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
2121
with:
22-
python-version: "3.13"
23-
- uses: actions/checkout@v5
22+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
23+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
24+
- uses: actions/checkout@v4
2425
with:
26+
token: ${{ steps.token.outputs.token }}
2527
fetch-depth: 0
26-
- name: Build ext package
27-
run: uv build --package=django-stubs-ext
28-
- name: Publish ext to PyPI
29-
uses: pypa/[email protected]
30-
31-
build-and-publish:
32-
runs-on: ubuntu-latest
33-
needs: [build-and-publish-ext]
34-
environment:
35-
name: release
36-
url: https://pypi.org/p/django-stubs
37-
permissions:
38-
id-token: write
39-
steps:
40-
- name: Install uv & Python
41-
uses: astral-sh/setup-uv@v7
28+
- name: Prepare release
29+
uses: getsentry/action-prepare-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4232
with:
43-
python-version: "3.13"
44-
- uses: actions/checkout@v5
45-
with:
46-
fetch-depth: 0
47-
- name: Build package
48-
run: uv build --package=django-stubs
49-
- name: Publish to PyPI
50-
uses: pypa/[email protected]
33+
version: ${{ github.event.inputs.version }}
34+
merge_target: ${{ github.event.inputs.merge_target }}

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
sentry-forked-django-stubs
2+
==========================
3+
4+
### new release
5+
6+
make a new branch for the fork of an upstream tag:
7+
8+
```bash
9+
git remote add upstream [email protected]:typeddjango/django-stubs
10+
git fetch upstream --tags
11+
git push origin --tags
12+
git checkout 1.2.3 -b sentry-1.2.3
13+
```
14+
15+
- cherry-pick the craft / release commit(s) into your branch from `master`
16+
- cherry-pick relevant commit(s) from previous releases
17+
18+
releases are done through craft in the release.yml workflow -- make sure to
19+
target your particular branch with a `.#` release postfix (like `1.2.3.0`)
20+
21+
___
22+
123
<img src="https://raw.githubusercontent.com/typeddjango/django-stubs/master/logo.svg" alt="django-stubs">
224

325
[![test](https://github.com/typeddjango/django-stubs/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/typeddjango/django-stubs/actions/workflows/test.yml)

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "django-stubs"
2+
name = "sentry-forked-django-stubs"
33
version = "5.2.7"
44
description = "Mypy stubs for Django"
55
readme = "README.md"
@@ -56,7 +56,7 @@ tests = [
5656
"pyyaml==6.0.2",
5757
# typing:
5858
"mypy==1.18.1",
59-
"django-stubs[compatible-mypy,oracle,redis]",
59+
"sentry-forked-django-stubs[compatible-mypy,oracle,redis]",
6060
]
6161
pyright = [
6262
"pyright==1.1.405",
@@ -73,7 +73,7 @@ Funding = "https://github.com/sponsors/typeddjango"
7373
"Release notes" = "https://github.com/typeddjango/django-stubs/releases"
7474

7575
[tool.uv.sources]
76-
django-stubs = { workspace = true }
76+
sentry-forked-django-stubs = { workspace = true }
7777
django-stubs-ext = { workspace = true }
7878

7979
[tool.uv.workspace]
@@ -84,7 +84,7 @@ requires = ["uv_build>=0.8.22,<0.9.0"]
8484
build-backend = "uv_build"
8585

8686
[tool.uv.build-backend]
87-
module-name = ["django-stubs", "mypy_django_plugin"]
87+
module-name = ["sentry-forked-django-stubs", "mypy_django_plugin"]
8888
module-root = ""
8989

9090
[tool.codespell]

scripts/bump-version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euxo pipefail
3+
4+
sed -i "s/^version = "'"'".*"'"'"$/version = "'"'"$2"'"'"/" pyproject.toml

0 commit comments

Comments
 (0)