Skip to content

Commit 33b335d

Browse files
authored
Merge branch 'sphinx-doc:master' into master
2 parents 709988f + d198d73 commit 33b335d

19 files changed

+413
-285
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
max-line-length = 95
3+
ignore = E116,E241,E251
4+
exclude = .git,.tox,.venv

.github/transifex.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Synchronise translations
2+
3+
on:
4+
schedule:
5+
# 22:38 GMT, every Sunday. Chosen to be a random time.
6+
- cron: "38 22 * * SUN"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
push:
14+
if: github.repository_owner == 'sphinx-doc'
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3
23+
- name: Install transifex client
24+
run: |
25+
mkdir -p /tmp/tx_cli && cd $_
26+
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
27+
shell: bash
28+
- name: Install dependencies
29+
run: pip install --upgrade babel jinja2
30+
- name: Extract translations from source code
31+
run: python utils/babel_runner.py extract
32+
- name: Push translations to transifex.com
33+
run: |
34+
cd sphinxcontrib/qthelp/locales
35+
/tmp/tx_cli/tx push --source --use-git-timestamps --workers 10
36+
env:
37+
TX_TOKEN: ${{ secrets.TX_TOKEN }}
38+
39+
pull:
40+
permissions:
41+
contents: write # for peter-evans/create-pull-request to create branch
42+
pull-requests: write # for peter-evans/create-pull-request to create a PR
43+
if: github.repository_owner == 'sphinx-doc'
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- uses: actions/checkout@v3
48+
- name: Set up Python
49+
uses: actions/setup-python@v4
50+
with:
51+
python-version: 3
52+
- name: Install transifex client
53+
run: |
54+
mkdir -p /tmp/tx_cli && cd $_
55+
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
56+
shell: bash
57+
- name: Install dependencies
58+
run: pip install --upgrade babel jinja2
59+
- name: Extract translations from source code
60+
run: python utils/babel_runner.py extract
61+
- name: Pull translations from transifex.com
62+
run: |
63+
cd sphinxcontrib/qthelp/locales
64+
/tmp/tx_cli/tx pull --translations --all --force --use-git-timestamps --workers 10
65+
env:
66+
TX_TOKEN: ${{ secrets.TX_TOKEN }}
67+
- name: Compile message catalogs
68+
run: python utils/babel_runner.py compile
69+
- name: Create Pull Request
70+
uses: peter-evans/create-pull-request@v4
71+
with:
72+
commit-message: "[internationalisation] Update translations"
73+
branch: bot/pull-translations
74+
title: "[bot]: Update message catalogues"
75+
labels: "internals:internationalisation"

.github/workflows/create-release.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Create release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*.*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
publish-pypi:
14+
runs-on: ubuntu-latest
15+
name: PyPI Release
16+
environment: release
17+
permissions:
18+
id-token: write # for PyPI trusted publishing
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: 3
25+
cache: pip
26+
cache-dependency-path: pyproject.toml
27+
28+
- name: Install build dependencies (pypa/build, twine)
29+
run: |
30+
pip install -U pip
31+
pip install build twine
32+
33+
- name: Build distribution
34+
run: python -m build
35+
36+
- name: Mint PyPI API token
37+
id: mint-token
38+
uses: actions/github-script@v6
39+
with:
40+
# language=JavaScript
41+
script: |
42+
// retrieve the ambient OIDC token
43+
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
44+
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
45+
const oidc_resp = await fetch(`${oidc_request_url}&audience=pypi`, {
46+
headers: {Authorization: `bearer ${oidc_request_token}`},
47+
});
48+
const oidc_token = (await oidc_resp.json()).value;
49+
50+
// exchange the OIDC token for an API token
51+
const mint_resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
52+
method: 'post',
53+
body: `{"token": "${oidc_token}"}` ,
54+
headers: {'Content-Type': 'application/json'},
55+
});
56+
const api_token = (await mint_resp.json()).token;
57+
58+
// mask the newly minted API token, so that we don't accidentally leak it
59+
core.setSecret(api_token)
60+
core.setOutput('api-token', api_token)
61+
62+
- name: Upload to PyPI
63+
env:
64+
TWINE_NON_INTERACTIVE: "true"
65+
TWINE_USERNAME: "__token__"
66+
TWINE_PASSWORD: "${{ steps.mint-token.outputs.api-token }}"
67+
run: |
68+
twine check dist/*
69+
twine upload dist/*
70+
71+
github-release:
72+
runs-on: ubuntu-latest
73+
name: GitHub release
74+
environment: release
75+
permissions:
76+
contents: write # for softprops/action-gh-release to create GitHub release
77+
steps:
78+
- uses: actions/checkout@v3
79+
- name: Get release version
80+
id: get_version
81+
uses: actions/github-script@v6
82+
with:
83+
script: core.setOutput('version', context.ref.replace("refs/tags/", ""))
84+
85+
- name: Create GitHub release
86+
uses: softprops/action-gh-release@v1
87+
if: startsWith(github.ref, 'refs/tags/')
88+
with:
89+
name: "sphinxcontrib-qthelp ${{ steps.get_version.outputs.version }}"
90+
body: "Changelog: https://www.sphinx-doc.org/en/master/changes.html"

.github/workflows/test.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
13+
14+
env:
15+
FORCE_COLOR: "1"
16+
PYTHONDEVMODE: "1" # -X dev
17+
PYTHONWARNDEFAULTENCODING: "1" # -X warn_default_encoding
18+
19+
jobs:
20+
tests:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python:
25+
- "3.9"
26+
- "3.10"
27+
- "3.11"
28+
- "3.12-dev"
29+
- "3.13-dev"
30+
fail-fast: false
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up Python ${{ matrix.python }}
35+
uses: actions/setup-python@v4
36+
if: "!endsWith(matrix.python, '-dev')"
37+
with:
38+
python-version: ${{ matrix.python }}
39+
- name: Set up Python ${{ matrix.python }} (deadsnakes)
40+
uses: deadsnakes/action@v2.1.1
41+
if: "endsWith(matrix.python, '-dev')"
42+
with:
43+
python-version: ${{ matrix.python }}
44+
- name: Install dependencies
45+
run: |
46+
python -m pip install --upgrade pip
47+
python -m pip install .[test,standalone]
48+
49+
- name: Test with pytest
50+
run: python -m pytest -vv --durations 25
51+
52+
test-latest-sphinx:
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v3
57+
- name: Set up Python ${{ matrix.python }}
58+
uses: actions/setup-python@v4
59+
with:
60+
python-version: "3"
61+
- name: Install dependencies
62+
run: |
63+
python -m pip install --upgrade pip
64+
python -m pip install .[test]
65+
python -m pip install "Sphinx @ git+https://github.com/sphinx-doc/sphinx"
66+
67+
- name: Test with pytest
68+
run: python -m pytest -vv --durations 25
69+
70+
lint:
71+
runs-on: ubuntu-latest
72+
strategy:
73+
matrix:
74+
env: [flake8, mypy]
75+
76+
steps:
77+
- uses: actions/checkout@v3
78+
- name: Setup python
79+
uses: actions/setup-python@v4
80+
with:
81+
python-version: "3"
82+
83+
- name: Install dependencies
84+
run: |
85+
python -m pip install --upgrade pip
86+
python -m pip install --upgrade tox
87+
88+
- name: Run tox
89+
run: tox -e ${{ matrix.env }}

CHANGES

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
Release 1.0.8 (2024-07-20)
2+
==========================
3+
4+
* Fix tests for Sphinx 7.4 and later.
5+
6+
Release 1.0.7 (2024-01-13)
7+
==========================
8+
9+
* Remove Sphinx as a required dependency, as circular dependencies may cause
10+
failure with package managers that expect a directed acyclic graph (DAG)
11+
of dependencies.
12+
13+
Release 1.0.6 (2023-08-14)
14+
==========================
15+
16+
* Use ``os.PathLike`` over ``pathlib.Path``
17+
18+
Release 1.0.5 (2023-08-09)
19+
==========================
20+
21+
* Fix tests for Sphinx 7.1 and below
22+
23+
Release 1.0.4 (2023-08-07)
24+
==========================
25+
26+
* Drop support for Python 3.5, 3.6, 3.7, and 3.8
27+
* Raise minimum required Sphinx version to 5.0
28+
129
Release 1.0.3 (2019-02-29)
230
==========================
331

MANIFEST.in

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)