8000 Merge branch 'main' into update-ci-py-versions · python/miss-islington@b2d99a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2d99a3

Browse files
authored
Merge branch 'main' into update-ci-py-versions
2 parents 7c5767c + 77abdb0 commit b2d99a3

11 files changed

+19
-3019
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ updates:
44
directory: "/"
55
schedule:
66
interval: monthly
7+
assignees:
8+
- "ezio-melotti"
9+
open-pull-requests-limit: 10
10+
11+
- package-ecosystem: "github-actions"
12+
directory: "/"
13+
schedule:
14+
interval: monthly
15+
assignees:
16+
- "ezio-melotti"
717
open-pull-requests-limit: 10
8-
ignore:
9-
- dependency-name: pytest-asyncio
10-
versions:
11-
- 0.15.0
12-
- dependency-name: sentry-sdk
13-
versions:
14-
- 0.20.0
15-
- 0.20.1
16-
- 0.20.2
17-
- 0.20.3

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
python-version: ["3.9", "3.10", "3.11", "3.12"]
1717

1818
steps:
19-
- uses: actions/checkout@v2
20-
- uses: actions/cache@v1
19+
- uses: actions/checkout@v3
20+
- uses: actions/cache@v3
2121
with:
2222
path: ~/.cache/pip
2323
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
@@ -29,7 +29,7 @@ jobs:
2929
allow-prereleases: true
3030
- run: python3 -m pip install -U -r dev-requirements.txt
3131
- run: pytest --cov=. --cov-report=xml
32-
- uses: codecov/codecov-action@v2
32+
- uses: codecov/codecov-action@v3
3333
if: always()
3434
with:
3535
token: ${{ secrets.CODECOV_TOKEN }}

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r requirements.txt
22
coverage
3-
pytest==7.2.2
3+
pytest==7.3.1
44
pytest-asyncio==0.21.0
55
pytest-aiohttp==1.0.4
66
pytest-cov==4.0.0

miss_islington/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
1313

1414

15-
from . import backport_pr, check_run, delete_branch, status_change
15+
from . import backport_pr, delete_branch
1616

1717
router = routing.Router(
18-
backport_pr.router, delete_branch.router, status_change.router, check_run.router
18+
backport_pr.router, delete_branch.router
1919
)
2020

2121
cache = cachetools.LRUCache(maxsize=500)

miss_islington/check_run.py

Lines changed: 0 additions & 34 deletions
This file was deleted.

miss_islington/status_change.py

Lines changed: 0 additions & 169 deletions
This file was deleted.

miss_islington/util.py

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
import gidgethub
55

6-
from .status_change import AUTOMERGE_TRAILER
7-
8-
AUTOMERGE_LABEL = ":robot: automerge"
96

107

118
async def comment_on_pr(gh, issue_number, message):
@@ -83,93 +80,3 @@ def normalize_title(title, body):
8380
# Being paranoid in case \r\n is used.
8481
return title[:-1] + body[1:].partition("\r\n")[0]
8582

86-
87-
def normalize_message(body):
88-
"""Normalize the message body to make it commit-worthy.
89-
90-
Mostly this just means removing HTML comments, but also removes unwanted
91-
leading or trailing whitespace.
92-
93-
Returns the normalized body.
94-
"""
95-
# Remove issue mentions added by Bedevere.
96-
# This should catch both current gh- and legacy bpo- messages.
97-
body = re.sub(r"(?s)<!-- (gh-)?issue-number:.*/\1issue-number -->", "", body)
98-
# Remove other HTML comments
99-
while "<!--" in body:
100-
body = body[: body.index("<!--")] + body[body.index("-->") + 3 :]
101-
# Delete BPO links on their own line, probably added by an old version of Bedevere.
102-
body = re.sub(r"\nhttps://bugs.python.org/issue(\d+)\n", "", body)
103-
# Strip additional newlines between commit body and automerge label.
104-
body_parts = body.split(AUTOMERGE_TRAILER)
105-
if len(body_parts) > 1:
106-
body, automerge_user = body_parts
107-
body = f"{body.strip()}\n\n{AUTOMERGE_TRAILER}{automerge_user}"
108-
return "\n\n" + body.strip()
109-
110-
111-
# Copied over from https://github.com/python/bedevere
112-
async def is_core_dev(gh, username):
113-
"""Check if the user is a CPython core developer."""
114-
org_teams = "/orgs/python/teams"
115-
team_name = "python core"
116-
async for team in gh.getiter(org_teams):
117-
if team["name"].lower() == team_name: # pragma: no branch
118-
break
119-
else:
120-
raise ValueError(f"{team_name!r} not found at {org_teams!r}")
121-
# The 'teams' object only provides a URL to a deprecated endpoint,
122-
# so manually construct the URL to the non-deprecated team membership
123-
# endpoint.
124-
membership_url = f"/teams/{team['id']}/memberships/{username}"
125-
try:
126-
await gh.getitem(membership_url)
127-
except gidgethub.BadRequest as exc:
128-
if exc.status_code == 404:
129-
return False
130-
raise
131-
else:
132-
return True
133-
134-
135-
def pr_is_awaiting_merge(pr_labels):
136-
label_names = [label["name"] for label in pr_labels]
137-
if (
138-
"DO-NOT-MERGE" not in label_names
139-
and "awaiting merge" in label_names
140-
and "CLA not signed" not in label_names
141-
):
142-
return True
143-
return False
144-
145-
146-
def pr_is_automerge(pr_labels):
147-
for label in pr_labels:
148-
if label["name"] == AUTOMERGE_LABEL:
149-
return True
150-
return False
151-
152-
153-
async def get_pr_for_commit(gh, sha):
154-
prs_for_commit = await gh.getitem(
155-
f"/search/issues?q=type:pr+repo:python/cpython+sha:{sha}"
156-
)
157-
if prs_for_commit["total_count"] > 0: # there should only be one
158-
pr_for_commit = prs_for_commit["items"][0]
159-
return pr_for_commit
160-
return None
161-
162-
163-
async def remove_automerge(gh, pr_data):
164-
"""Remove the automerge label"""
165-
await gh.delete(
166-
f"{pr_data['issue_url']}/labels/{AUTOMERGE_LABEL}",
167-
accept="application/vnd.github.symmetra-preview+json",
168-
)
169-
170-
171-
async def get_check_runs_for_sha(gh, sha):
172-
return await gh.getitem(
173-
f"/repos/python/cpython/commits/{sha}/check-runs",
174-
accept="application/vnd.github.antiope-preview+json",
175-
)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gidgethub==5.2.1
55
cachetools==5.3.0
66
redis==4.5.4
77
celery==5.2.7
8-
sentry-sdk==1.18.0
8+
sentry-sdk==1.21.1
99
click==8.1.3
1010

1111
# workaround for celery/kombu#1600

0 commit comments

Comments
 (0)
0