Skip to content

Commit b1c5803

Browse files
authored
Merge branch 'main' into patch-2
2 parents 09d4cf3 + 56c1fef commit b1c5803

File tree

57 files changed

+3479
-677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3479
-677
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
source/guides/github-actions-ci-cd-sample/* @webknjaz
22
source/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows.rst @webknjaz
3+
4+
# build-details.json
5+
source/specifications/build-details/ @FFY00
6+
source/specifications/specs/build-details-*.json @FFY00

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ on:
66
branches-ignore:
77
- gh-readonly-queue/** # Temporary merge queue-related GH-made branches
88
pull_request:
9+
types:
10+
- opened # default
11+
- synchronize # default
12+
- reopened # default
13+
- ready_for_review # used in PRs created from GitHub Actions workflows
914
workflow_call:
1015

1116
concurrency:
1217
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1318
cancel-in-progress: true
1419

20+
permissions: {}
21+
1522
jobs:
1623
build:
1724
name: ${{ matrix.noxenv }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
3+
name: Update uv build version
4+
5+
on:
6+
schedule:
7+
- cron: "0 6 * * 1" # mondays at 6am
8+
workflow_dispatch:
9+
10+
jobs:
11+
update-uv-build-version:
12+
name: Update uv_build version
13+
if: github.repository_owner == 'pypa' # suppress noise in forks
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
persist-credentials: false
23+
- name: Set up uv
24+
uses: astral-sh/setup-uv@v5
25+
- name: Update uv_build version
26+
id: update_script
27+
run: uv run scripts/update_uv_build_version.py
28+
- # If there are no changes, no pull request will be created and the action exits silently.
29+
name: Create Pull Request
30+
uses: peter-evans/create-pull-request@v7
31+
with:
32+
token: ${{ secrets.GITHUB_TOKEN }}
33+
commit-message: Update uv_build version to ${{ steps.update_script.outputs.version }}
34+
title: Update uv_build version to ${{ steps.update_script.outputs.version }}
35+
draft: true # Trigger CI by un-drafting the PR, otherwise `GITHUB_TOKEN` PRs don't trigger CI.
36+
body: |
37+
Automated update of uv_build version bounds for uv ${{ steps.update_script.outputs.version }}.
38+
39+
This PR was created automatically by the cron workflow, ping `@konstin` for problems.
40+
branch: bot/update-uv-build-version
41+
delete-branch: true
42+
43+
...

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- id: trailing-whitespace
1616

1717
- repo: https://github.com/codespell-project/codespell
18-
rev: v2.3.0
18+
rev: v2.4.1
1919
hooks:
2020
- id: codespell
2121
args: ["-L", "ned,ist,oder", "--skip", "*.po"]
@@ -37,7 +37,7 @@ repos:
3737
- id: rst-inline-touching-normal
3838

3939
- repo: https://github.com/astral-sh/ruff-pre-commit
40-
rev: v0.7.1
40+
rev: v0.12.2
4141
hooks:
4242
- id: ruff
4343
- id: ruff-format

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sphinx-autobuild==2021.3.14
44
sphinx-inline-tabs==2023.4.21
55
sphinx-copybutton==0.5.2
66
sphinx-toolbox==3.5.0
7+
sphinx-jsonschema==1.19.1

scripts/update_uv_build_version.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# /// script
2+
# requires-python = ">= 3.12"
3+
# dependencies = [
4+
# "httpx>=0.28.1,<0.29",
5+
# "packaging>=25.0",
6+
# ]
7+
# ///
8+
import os
9+
import re
10+
from pathlib import Path
11+
12+
import httpx
13+
from packaging.utils import parse_wheel_filename
14+
from packaging.version import Version
15+
16+
17+
def main():
18+
response = httpx.get(
19+
"https://pypi.org/simple/uv-build/",
20+
headers={"Accept": "application/vnd.pypi.simple.v1+json"},
21+
)
22+
response.raise_for_status()
23+
data = response.json()
24+
current_release = None
25+
for file in data["files"]:
26+
if not file["filename"].endswith(".whl"):
27+
continue
28+
_name, version, _build, _tags = parse_wheel_filename(file["filename"])
29+
if version.is_prerelease:
30+
continue
31+
if current_release is None or version > current_release:
32+
current_release = version
33+
34+
[major, minor, _patch] = current_release.release
35+
if major != 0:
36+
raise NotImplementedError("The script needs to be updated for uv 1.x")
37+
upper_bound = Version(f"{major}.{minor + 1}.0")
38+
39+
repository_root = Path(__file__).parent.parent
40+
existing = repository_root.joinpath(
41+
"source/shared/build-backend-tabs.rst"
42+
).read_text()
43+
replacement = f'requires = ["uv_build >= {current_release}, <{upper_bound}"]'
44+
searcher = re.compile(re.escape('requires = ["uv_build') + ".*" + re.escape('"]'))
45+
if not searcher.search(existing):
46+
raise RuntimeError("Could not `uv-build` entry")
47+
updated = searcher.sub(replacement, existing)
48+
49+
if existing != updated:
50+
print("Updating source/shared/build-backend-tabs.rst")
51+
Path("source/shared/build-backend-tabs.rst").write_text(updated)
52+
if github_output := os.environ.get("GITHUB_OUTPUT"):
53+
with open(github_output, "a") as f:
54+
f.write(f"version={current_release}\n")
55+
f.write("updated=true\n")
56+
else:
57+
print("Already up-to-date source/shared/build-backend-tabs.rst")
58+
if github_output := os.environ.get("GITHUB_OUTPUT"):
59+
with open(github_output, "a") as f:
60+
f.write("updated=false\n")
61+
62+
63+
if __name__ == "__main__":
64+
main()

source/conf.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"sphinx_inline_tabs",
2929
"sphinx_copybutton",
3030
"sphinx_toolbox.collapse",
31+
"sphinx-jsonschema",
3132
]
3233

3334
nitpicky = True
@@ -72,9 +73,9 @@
7273

7374
_metrics_js_files = [
7475
(
75-
"https://plausible.io/js/script.js",
76+
"https://analytics.python.org/js/script.outbound-links.js",
7677
{"data-domain": "packaging.python.org", "defer": "defer"},
77-
)
78+
),
7879
]
7980
html_js_files = []
8081
if RTD_CANONICAL_BUILD:
@@ -127,24 +128,31 @@
127128
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-the-linkcheck-builder
128129

129130
linkcheck_ignore = [
130-
"http://localhost:\\d+",
131-
"https://test.pypi.org/project/example-package-YOUR-USERNAME-HERE",
132-
"https://pypi.org/manage/*",
133-
"https://test.pypi.org/manage/*",
131+
r"http://localhost:\d+",
132+
r"https://packaging\.python\.org/en/latest/specifications/schemas/.*",
133+
r"https://test\.pypi\.org/project/example-package-YOUR-USERNAME-HERE",
134+
r"https://pypi\.org/manage/.*",
135+
r"https://test\.pypi\.org/manage/.*",
134136
# Temporarily ignored. Ref:
135137
# https://github.com/pypa/packaging.python.org/pull/1308#issuecomment-1775347690
136-
"https://www.breezy-vcs.org/*",
138+
r"https://www\.breezy-vcs\.org/.*",
137139
# Ignore while StackOverflow is blocking GitHub CI. Ref:
138140
# https://github.com/pypa/packaging.python.org/pull/1474
139-
"https://stackoverflow.com/*",
140-
"https://pyscaffold.org/*",
141-
"https://anaconda.org",
141+
r"https://stackoverflow\.com/.*",
142+
r"https://pyscaffold\.org/.*",
143+
r"https://anaconda\.org",
144+
r"https://www\.cisa\.gov/sbom",
145+
r"https://developers\.redhat\.com/products/softwarecollections/overview",
146+
r"https://math-atlas\.sourceforge\.net/?",
147+
r"https://click\.palletsprojects\.com/.*",
148+
r"https://typer\.tiangolo\.com/.*",
142149
]
143150
linkcheck_retries = 5
144151
# Ignore anchors for common targets when we know they likely won't be found
145152
linkcheck_anchors_ignore_for_url = [
146153
# GitHub synthesises anchors in JavaScript, so Sphinx can't find them in the HTML
147154
r"https://github\.com/",
155+
r"https://docs\.github\.com/",
148156
# While PyPI has its botscraping defenses active, Sphinx can't resolve the anchors
149157
# https://github.com/pypa/packaging.python.org/issues/1744
150158
r"https://pypi\.org/",

source/contribute.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ including:
1111
* Reviewing new contributions
1212
* Revising existing content
1313
* Writing new content
14-
* Translate the guide
14+
* Translating the guide
1515

1616
Most of the work on the |PyPUG| takes place on the
1717
`project's GitHub repository`__. To get started, check out the list of
@@ -103,7 +103,6 @@ If you are not familiar with reStructuredText (RST) syntax, please read `this gu
103103
before translating on Weblate.
104104

105105
**Do not translate the text in reference directly**
106-
107106
When translating the text in reference, please do not translate them directly.
108107

109108
| Wrong: Translate the following text directly:

source/discussions/deploying-python-applications.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Supporting multiple hardware platforms
2323
For Python-only distributions, it *should* be straightforward to deploy on all
2424
platforms where Python can run.
2525

26-
For distributions with binary extensions, deployment is major headache. Not only
26+
For distributions with binary extensions, deployment is a major headache. Not only
2727
must the extensions be built on all the combinations of operating system and
2828
hardware platform, but they must also be tested, preferably on continuous
2929
integration platforms. The issues are similar to the "multiple Python

0 commit comments

Comments
 (0)