Skip to content

Commit a158669

Browse files
committed
Merge remote-tracking branch 'upstream/master' into spdx-id-collision
2 parents dfdd221 + bbcee07 commit a158669

18 files changed

Lines changed: 1629 additions & 841 deletions

.github/workflows/source-and-docs-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ name: "Build Python source and docs artifacts"
4040
# Set from inputs for workflow_dispatch, or set defaults to test push/PR events
4141
env:
4242
GIT_REMOTE: ${{ github.event.inputs.git_remote || 'python' }}
43-
GIT_COMMIT: ${{ github.event.inputs.git_commit || 'f6650f9ad73359051f3e558c2431a109bc016664' }}
44-
CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.12.3' }}
43+
GIT_COMMIT: ${{ github.event.inputs.git_commit || '4f8bb3947cfbc20f970ff9d9531e1132a9e95396' }}
44+
CPYTHON_RELEASE: ${{ github.event.inputs.cpython_release || '3.13.2' }}
4545

4646
jobs:
4747
verify-input:
@@ -92,7 +92,7 @@ jobs:
9292
- name: "Setup Python"
9393
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
9494
with:
95-
python-version: 3.11
95+
python-version: 3.12
9696

9797
- name: "Install source dependencies"
9898
run: |
@@ -105,7 +105,7 @@ jobs:
105105
python ../release.py --export "$CPYTHON_RELEASE" --skip-docs
106106
107107
- name: "Upload the source artifacts"
108-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
108+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
109109
with:
110110
name: source
111111
path: |
@@ -129,7 +129,7 @@ jobs:
129129
- name: "Setup Python"
130130
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
131131
with:
132-
python-version: 3.11
132+
python-version: 3.12
133133

134134
- name: "Install docs dependencies"
135135
run: |
@@ -148,7 +148,7 @@ jobs:
148148
SPHINXOPTS="-j10" make dist
149149
150150
- name: "Upload the docs artifacts"
151-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
151+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
152152
with:
153153
name: docs
154154
path: |

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15+
python-version: ["3.12", "3.13"]
1516
os: [macos-latest, ubuntu-latest]
1617
steps:
1718
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1819
with:
1920
persist-credentials: false
2021
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
2122
with:
22-
python-version: 3.12
23+
python-version: ${{ matrix.python-version }}
2324
cache: pip
2425
cache-dependency-path: dev-requirements.txt
2526
- run: |

.pre-commit-config.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.7.1
3+
rev: v0.8.2
44
hooks:
55
- id: ruff
66
args: [--exit-non-zero-on-fix]
@@ -25,23 +25,28 @@ repos:
2525
- id: trailing-whitespace
2626

2727
- repo: https://github.com/python-jsonschema/check-jsonschema
28-
rev: 0.29.4
28+
rev: 0.30.0
2929
hooks:
3030
- id: check-dependabot
3131
- id: check-github-workflows
3232

3333
- repo: https://github.com/rhysd/actionlint
34-
rev: v1.7.3
34+
rev: v1.7.4
3535
hooks:
3636
- id: actionlint
3737

38+
- repo: https://github.com/woodruffw/zizmor-pre-commit
39+
rev: v0.8.0
40+
hooks:
41+
- id: zizmor
42+
3843
- repo: https://github.com/tox-dev/pyproject-fmt
39-
rev: v2.4.3
44+
rev: v2.5.0
4045
hooks:
4146
- id: pyproject-fmt
4247

4348
- repo: https://github.com/abravalheri/validate-pyproject
44-
rev: v0.22
49+
rev: v0.23
4550
hooks:
4651
- id: validate-pyproject
4752

add_to_pydotorg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import re
3030
import subprocess
3131
import sys
32+
from collections.abc import Generator
3233
from os import path
33-
from typing import Any, Generator, NoReturn
34+
from typing import Any, NoReturn
3435

3536
import requests
3637

buildbotapi.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import asyncio
21
import json
32
from dataclasses import dataclass
43
from typing import Any, cast
@@ -12,7 +11,6 @@
1211
class Builder:
1312
builderid: int
1413
description: str | None
15-
masterids: list[int]
1614
name: str
1715
tags: list[str]
1816

@@ -23,26 +21,6 @@ def __hash__(self) -> int:
2321
return hash(self.builderid)
2422

2523

26-
@dataclass
27-
class Build:
28-
id: int
29-
is_currently_failing: bool
30-
builderid: int
31-
builder: Builder | None
32-
33-
def __init__(self, **kwargs: Any) -> None:
34-
self.__dict__.update(**kwargs)
35-
self.id = int(kwargs.get("number", -1))
36-
self.is_currently_failing = kwargs.get("currently_failing", False)
37-
self.builder = None
38-
39-
def __eq__(self, other: object) -> bool:
40-
return isinstance(other, Build) and self.id == other.id
41-
42-
def __hash__(self) -> int:
43-
return hash(self.id)
44-
45-
4624
class BuildBotAPI:
4725
def __init__(self, session: ClientSession) -> None:
4826
self._session = session
@@ -91,44 +69,3 @@ async def is_builder_failing_currently(self, builder: Builder) -> bool:
9169
if build["results"] == 2:
9270
return True
9371
return False
94-
95-
async def get_build(self, builder_id: int, build_id: int) -> Build:
96-
data = await self._fetch_json(
97-
f"https://buildbot.python.org/all/api/v2/builders/{builder_id}"
98-
f"/builds/{build_id}"
99-
)
100-
(build_data,) = data["builds"]
101-
build: Build = Build(**build_data)
102-
build.builder = (await self.all_builders())[build.builderid]
103-
build.is_currently_failing = await self.is_builder_failing_currently(
104-
build.builder
105-
)
106-
return build
107-
108-
async def get_recent_failures(self, limit: int = 100) -> set[Build]:
109-
data = await self._fetch_json(
110-
f"https://buildbot.python.org/all/api/v2/builds?"
111-
f"complete__eq=true&&results__eq=2&&"
112-
f"order=-complete_at&&limit={limit}"
113-
)
114-
115-
stable_builders = await self.stable_builders()
116-
117-
all_failures = {
118-
Build(**build)
119-
for build in data["builds"]
120-
if build["builderid"] in stable_builders
121-
}
122-
123-
for failure in all_failures:
124-
failure.builder = stable_builders[failure.builderid]
125-
126-
async def _get_missing_info(failure: Build) -> None:
127-
assert failure.builder is not None
128-
failure.is_currently_failing = await self.is_builder_failing_currently(
129-
failure.builder
130-
)
131-
132-
await asyncio.gather(*[_get_missing_info(failure) for failure in all_failures])
133-
134-
return all_failures

dev-requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
2+
pytest-aiohttp
23
pytest-cov
34
pytest-mock

0 commit comments

Comments
 (0)