Skip to content

Commit eafd2e9

Browse files
committed
Merge remote-tracking branch 'origin/main' into raises_paramspec
2 parents 3d96dc6 + 544f589 commit eafd2e9

File tree

15 files changed

+309
-145
lines changed

15 files changed

+309
-145
lines changed

.github/workflows/prepare-release-pr.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030
- uses: actions/checkout@v4
3131
with:
3232
fetch-depth: 0
33-
persist-credentials: false
33+
# persist-credentials is needed in order for us to push the release branch.
34+
persist-credentials: true
3435

3536
- name: Set up Python
3637
uses: actions/setup-python@v5
@@ -47,13 +48,15 @@ jobs:
4748
env:
4849
BRANCH: ${{ github.event.inputs.branch }}
4950
PRERELEASE: ${{ github.event.inputs.prerelease }}
51+
GH_TOKEN: ${{ github.token }}
5052
run: |
51-
tox -e prepare-release-pr -- "$BRANCH" ${{ github.token }} --prerelease="$PRERELEASE"
53+
tox -e prepare-release-pr -- "$BRANCH" --prerelease="$PRERELEASE"
5254
5355
- name: Prepare release PR (major release)
5456
if: github.event.inputs.major == 'yes'
5557
env:
5658
BRANCH: ${{ github.event.inputs.branch }}
5759
PRERELEASE: ${{ github.event.inputs.prerelease }}
60+
GH_TOKEN: ${{ github.token }}
5861
run: |
59-
tox -e prepare-release-pr -- "$BRANCH" ${{ github.token }} --major --prerelease="$PRERELEASE"
62+
tox -e prepare-release-pr -- "$BRANCH" --major --prerelease="$PRERELEASE"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 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.9.10"
3+
rev: "v0.11.2"
44
hooks:
55
- id: ruff
66
args: ["--fix"]
@@ -12,7 +12,7 @@ repos:
1212
- id: end-of-file-fixer
1313
- id: check-yaml
1414
- repo: https://github.com/woodruffw/zizmor-pre-commit
15-
rev: v1.4.1
15+
rev: v1.5.2
1616
hooks:
1717
- id: zizmor
1818
- repo: https://github.com/adamchainz/blacken-docs

RELEASING.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ Both automatic and manual processes described above follow the same steps from t
137137
in https://github.com/pytest-dev/pytest/actions/workflows/deploy.yml, using the ``release-MAJOR.MINOR.PATCH`` branch
138138
as source.
139139

140+
Using the command-line::
141+
142+
$ gh workflow run deploy.yml -R pytest-dev/pytest --ref=release-{VERSION} -f version={VERSION}
143+
140144
This job will require approval from ``pytest-dev/core``, after which it will publish to PyPI
141145
and tag the repository.
142146

changelog/13291.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed ``repr`` of ``attrs`` objects in assertion failure messages when using ``attrs>=25.2``.

changelog/13317.packaging.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Specified minimum allowed versions of ``colorama``, ``iniconfig``,
2+
and ``packaging``; and bumped the minimum allowed version
3+
of ``exceptiongroup`` for ``python_version<'3.11'`` from a release
4+
candidate to a full release.

doc/en/reference/plugin_list.rst

Lines changed: 253 additions & 85 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ dynamic = [
4646
"version",
4747
]
4848
dependencies = [
49-
"colorama; sys_platform=='win32'",
50-
"exceptiongroup>=1.0.0rc8; python_version<'3.11'",
51-
"iniconfig",
52-
"packaging",
49+
"colorama>=0.4; sys_platform=='win32'",
50+
"exceptiongroup>=1; python_version<'3.11'",
51+
"iniconfig>=1",
52+
"packaging>=20",
5353
"pluggy>=1.5,<2",
5454
"pygments>=2.7.2",
5555
"tomli>=1; python_version<'3.11'",
@@ -167,6 +167,10 @@ lint.per-file-ignores."src/_pytest/_py/**/*.py" = [
167167
lint.per-file-ignores."src/_pytest/_version.py" = [
168168
"I001",
169169
]
170+
# can't be disabled on a line-by-line basis in file
171+
lint.per-file-ignores."testing/code/test_source.py" = [
172+
"F841",
173+
]
170174
lint.per-file-ignores."testing/python/approx.py" = [
171175
"B015",
172176
]

scripts/prepare-release-pr.py

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
1111
After that, it will create a release using the `release` tox environment, and push a new PR.
1212
13-
**Token**: currently the token from the GitHub Actions is used, pushed with
14-
`pytest bot <[email protected]>` commit author.
13+
Note: the script uses the `gh` command-line tool, so `GH_TOKEN` must be set in the environment.
1514
"""
1615

1716
from __future__ import annotations
@@ -25,7 +24,6 @@
2524

2625
from colorama import Fore
2726
from colorama import init
28-
from github3.repos import Repository
2927

3028

3129
class InvalidFeatureRelease(Exception):
@@ -54,17 +52,7 @@ class InvalidFeatureRelease(Exception):
5452
"""
5553

5654

57-
def login(token: str) -> Repository:
58-
import github3
59-
60-
github = github3.login(token=token)
61-
owner, repo = SLUG.split("/")
62-
return github.repository(owner, repo)
63-
64-
65-
def prepare_release_pr(
66-
base_branch: str, is_major: bool, token: str, prerelease: str
67-
) -> None:
55+
def prepare_release_pr(base_branch: str, is_major: bool, prerelease: str) -> None:
6856
print()
6957
print(f"Processing release for branch {Fore.CYAN}{base_branch}")
7058

@@ -131,22 +119,25 @@ def prepare_release_pr(
131119
check=True,
132120
)
133121

134-
oauth_url = f"https://{token}:[email protected]/{SLUG}.git"
135122
run(
136-
["git", "push", oauth_url, f"HEAD:{release_branch}", "--force"],
123+
["git", "push", "origin", f"HEAD:{release_branch}", "--force"],
137124
check=True,
138125
)
139126
print(f"Branch {Fore.CYAN}{release_branch}{Fore.RESET} pushed.")
140127

141128
body = PR_BODY.format(version=version)
142-
repo = login(token)
143-
pr = repo.create_pull(
144-
f"Prepare release {version}",
145-
base=base_branch,
146-
head=release_branch,
147-
body=body,
129+
run(
130+
[
131+
"gh",
132+
"pr",
133+
"new",
134+
f"--base={base_branch}",
135+
f"--head={release_branch}",
136+
f"--title=Release {version}",
137+
f"--body={body}",
138+
],
139+
check=True,
148140
)
149-
print(f"Pull request {Fore.CYAN}{pr.url}{Fore.RESET} created.")
150141

151142

152143
def find_next_version(
@@ -174,14 +165,12 @@ def main() -> None:
174165
init(autoreset=True)
175166
parser = argparse.ArgumentParser()
176167
parser.add_argument("base_branch")
177-
parser.add_argument("token")
178168
parser.add_argument("--major", action="store_true", default=False)
179169
parser.add_argument("--prerelease", default="")
180170
options = parser.parse_args()
181171
prepare_release_pr(
182172
base_branch=options.base_branch,
183173
is_major=options.major,
184-
token=options.token,
185174
prerelease=options.prerelease,
186175
)
187176

scripts/update-plugin-list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"nuts",
6868
"flask_fixture",
6969
"databricks-labs-pytester",
70+
"tursu",
7071
}
7172

7273

src/_pytest/assertion/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def has_default_eq(
169169
code_filename = obj.__eq__.__code__.co_filename
170170

171171
if isattrs(obj):
172-
return "attrs generated eq" in code_filename
172+
return "attrs generated " in code_filename
173173

174174
return code_filename == "<string>" # data class
175175
return True

0 commit comments

Comments
 (0)