Skip to content

Commit 342724a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into more-indexes-2
2 parents 646f612 + c8f51ab commit 342724a

File tree

58 files changed

+3682
-1622
lines changed

Some content is hidden

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

58 files changed

+3682
-1622
lines changed

.github/sphinx_lint_matcher.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "sphinx-lint-problem-matcher",
5+
"pattern": [
6+
{
7+
"regexp": "^(.*):(\\d+):\\s+(.*)$",
8+
"file": 1,
9+
"line": 2,
10+
"message": 3
11+
}
12+
]
13+
}
14+
]
15+
}

.github/workflows/cron.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
name: Cron
4+
5+
on:
6+
schedule:
7+
- cron: "0 6 * * *" # daily at 6am
8+
9+
jobs:
10+
test:
11+
if: github.repository_owner == 'pypa' # suppress noise in forks
12+
uses: ./.github/workflows/test.yml
13+
14+
...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Read the Docs PR preview
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
documentation-links:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: readthedocs/actions/preview@v1
21+
with:
22+
project-slug: "python-packaging-user-guide"
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Test translations
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
- '**.po'
8+
branches:
9+
- translation/source
10+
push:
11+
paths:
12+
- '**.po'
13+
branches:
14+
- translation/source
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
21+
cancel-in-progress: true
22+
23+
env:
24+
I18N_BRANCH: translation/source
25+
26+
jobs:
27+
matrix:
28+
runs-on: ubuntu-latest
29+
outputs:
30+
languages: ${{ steps.languages.outputs.languages }}
31+
32+
steps:
33+
- name: Grab the repo src
34+
uses: actions/checkout@v4
35+
with:
36+
ref: ${{ env.I18N_BRANCH }}
37+
38+
- name: List languages
39+
id: languages
40+
working-directory: locales
41+
run: |
42+
list=$(find * -maxdepth 0 -type d | jq -nRc '[inputs]')
43+
echo "languages=$list" >> $GITHUB_OUTPUT
44+
45+
46+
test-translation:
47+
runs-on: ubuntu-latest
48+
needs: matrix
49+
strategy:
50+
fail-fast: false
51+
matrix:
52+
language: ${{fromJson(needs.matrix.outputs.languages)}}
53+
54+
steps:
55+
- name: Grab the repo src
56+
uses: actions/checkout@v4
57+
with:
58+
ref: ${{ env.I18N_BRANCH }}
59+
60+
- name: Set up Python
61+
uses: actions/setup-python@v5
62+
with:
63+
python-version: >-
64+
3.10
65+
66+
- name: Install Python tooling
67+
run: python -m pip install --upgrade nox virtualenv sphinx-lint
68+
69+
- name: Set Sphinx problem matcher
70+
uses: sphinx-doc/[email protected]
71+
72+
- name: Build translated docs in ${{ matrix.language }}
73+
run: nox -s build -- -q -D language=${{ matrix.language }}
74+
75+
- name: Set Sphinx Lint problem matcher
76+
if: always()
77+
run: echo '::add-matcher::.github/sphinx_lint_matcher.json'
78+
79+
- name: Lint translation file
80+
if: always()
81+
run: sphinx-lint locales/${{ matrix.language }}/LC_MESSAGES/messages.po

.github/workflows/test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ on:
66
branches-ignore:
77
- gh-readonly-queue/** # Temporary merge queue-related GH-made branches
88
pull_request:
9-
schedule:
10-
- cron: "0 6 * * *" # daily at 6am
9+
workflow_call:
1110

1211
concurrency:
1312
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}

.github/workflows/translation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
if: github.repository_owner == 'pypa'
1819

1920
steps:
2021
- name: Grab the repo src
@@ -65,6 +66,7 @@ jobs:
6566
run: |
6667
git_hash=$(git rev-parse --short "${GITHUB_SHA}")
6768
git add --force locales/messages.pot
69+
git diff-index --quiet HEAD || \
6870
git commit \
6971
-m "Update messages.pot as of version ${git_hash}" \
7072
locales/messages.pot

.pre-commit-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
rev: v2.2.6
1616
hooks:
1717
- id: codespell
18-
args: ["-L", "ned"]
18+
args: ["-L", "ned,ist,oder", "--skip", "*.po"]
1919

2020
- repo: local
2121
hooks:
@@ -24,6 +24,7 @@ repos:
2424
language: pygrep
2525
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
2626
exclude: .pre-commit-config.yaml
27+
exclude_types: ["pofile"]
2728

2829
- repo: https://github.com/pre-commit/pygrep-hooks
2930
rev: v1.10.0
@@ -33,7 +34,7 @@ repos:
3334
- id: rst-inline-touching-normal
3435

3536
- repo: https://github.com/astral-sh/ruff-pre-commit
36-
rev: v0.1.4
37+
rev: v0.1.14
3738
hooks:
3839
- id: ruff
3940
- id: ruff-format

0 commit comments

Comments
 (0)