Skip to content

Commit 48281f0

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-3.13
2 parents 8352f62 + c2d3eb6 commit 48281f0

16 files changed

+1470
-717
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
109109
with:
110110
name: source
111111
path: |
@@ -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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
152152
with:
153153
name: docs
154154
path: |

.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)