Skip to content

Commit 12e92df

Browse files
authored
Merge branch 'main' into added_obsolete
2 parents d441b5b + 8eab89a commit 12e92df

11 files changed

+279
-96
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Test
22

33
on:
4+
merge_group:
45
push:
56
pull_request:
67
schedule:
@@ -27,7 +28,7 @@ jobs:
2728
- name: Set up Python
2829
uses: actions/setup-python@v4
2930
with:
30-
python-version: 3.9
31+
python-version: "3.11"
3132
cache: 'pip'
3233
cache-dependency-path: 'requirements.txt'
3334

@@ -38,3 +39,21 @@ jobs:
3839
- name: Nox ${{ matrix.noxenv }}
3940
run: |
4041
python -m nox -s ${{ matrix.noxenv }}
42+
43+
44+
check:
45+
# This job does nothing and is only used for the branch protection
46+
# or multi-stage CI jobs, like making sure that all tests pass before
47+
# a publishing job is started.
48+
if: always()
49+
50+
needs:
51+
- build
52+
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- name: Decide whether the needed jobs succeeded or failed
57+
uses: re-actors/alls-green@release/v1
58+
with:
59+
jobs: ${{ toJSON(needs) }}

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sphinx-inline-tabs==2021.4.11b9
44
python-docs-theme==2022.1
55
sphinx-copybutton==0.5.0
66
pypa-docs-theme @ git+https://github.com/pypa/pypa-docs-theme.git
7+
sphinx-toolbox==3.5.0

source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'sphinx.ext.todo',
3737
'sphinx_inline_tabs',
3838
'sphinx_copybutton',
39+
'sphinx_toolbox.collapse',
3940
]
4041

4142
# config for copy button

source/contribute.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ document <discussions/install-requires-vs-requirements>`.
6363
Specifications
6464
--------------
6565

66-
Specifications are reference documention focused on comprehensively documenting
66+
Specifications are reference documentation focused on comprehensively documenting
6767
an agreed-upon interface for interoperability between packaging tools.
6868
:doc:`example specification-style document <specifications/core-metadata>`.
6969

@@ -131,9 +131,9 @@ need:
131131
132132
python -m pip install --user nox
133133
134-
2. Python 3.8. Our build scripts are usually tested with Python 3.8 only.
134+
2. Python 3.11. Our build scripts are usually tested with Python 3.11 only.
135135
See the :doc:`Hitchhiker's Guide to Python installation instructions <python-guide:starting/installation>`
136-
to install Python 3.8 on your operating system.
136+
to install Python 3.11 on your operating system.
137137

138138
To build the guide, run the following shell command in the project's root folder:
139139

Lines changed: 87 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
1+
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
22

33
on: push
44

55
jobs:
6-
build-n-publish:
7-
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
6+
build:
7+
name: Build distribution 📦
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
- name: Set up Python
1313
uses: actions/setup-python@v4
1414
with:
@@ -20,21 +20,90 @@ jobs:
2020
build
2121
--user
2222
- name: Build a binary wheel and a source tarball
23-
run: >-
24-
python3 -m
25-
build
26-
--sdist
27-
--wheel
28-
--outdir dist/
29-
.
30-
# Actually publish to PyPI/TestPyPI
31-
- name: Publish distribution 📦 to Test PyPI
32-
uses: pypa/gh-action-pypi-publish@release/v1
23+
run: python3 -m build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v3
3326
with:
34-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
35-
repository-url: https://test.pypi.org/legacy/
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-pypi:
31+
name: >-
32+
Publish Python 🐍 distribution 📦 to PyPI
33+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
34+
needs:
35+
- build
36+
runs-on: ubuntu-latest
37+
environment:
38+
name: pypi
39+
url: https://pypi.org/p/<package-name> # Replace <package-name> with your PyPI project name
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
42+
43+
steps:
44+
- name: Download all the dists
45+
uses: actions/download-artifact@v3
46+
with:
47+
name: python-package-distributions
48+
path: dist/
3649
- name: Publish distribution 📦 to PyPI
37-
if: startsWith(github.ref, 'refs/tags')
3850
uses: pypa/gh-action-pypi-publish@release/v1
51+
52+
github-release:
53+
name: >-
54+
Sign the Python 🐍 distribution 📦 with Sigstore
55+
and upload them to GitHub Release
56+
needs:
57+
- publish-to-pypi
58+
runs-on: ubuntu-latest
59+
60+
permissions:
61+
contents: write # IMPORTANT: mandatory for making GitHub Releases
62+
id-token: write # IMPORTANT: mandatory for sigstore
63+
64+
steps:
65+
- name: Download all the dists
66+
uses: actions/download-artifact@v3
67+
with:
68+
name: python-package-distributions
69+
path: dist/
70+
- name: Sign the dists with Sigstore
71+
uses: sigstore/[email protected]
3972
with:
40-
password: ${{ secrets.PYPI_API_TOKEN }}
73+
inputs: >-
74+
./dist/*.tar.gz
75+
./dist/*.whl
76+
- name: Upload artifact signatures to GitHub Release
77+
env:
78+
GITHUB_TOKEN: ${{ github.token }}
79+
# Upload to GitHub Release using the `gh` CLI.
80+
# `dist/` contains the built packages, and the
81+
# sigstore-produced signatures and certificates.
82+
run: >-
83+
gh release upload
84+
'${{ github.ref_name }}' dist/**
85+
--repo '${{ github.repository }}'
86+
87+
publish-to-testpypi:
88+
name: Publish Python 🐍 distribution 📦 to TestPyPI
89+
needs:
90+
- build
91+
runs-on: ubuntu-latest
92+
93+
environment:
94+
name: testpypi
95+
url: https://test.pypi.org/p/<package-name>
96+
97+
permissions:
98+
id-token: write # IMPORTANT: mandatory for trusted publishing
99+
100+
steps:
101+
- name: Download all the dists
102+
uses: actions/download-artifact@v3
103+
with:
104+
name: python-package-distributions
105+
path: dist/
106+
- name: Publish distribution 📦 to TestPyPI
107+
uses: pypa/gh-action-pypi-publish@release/v1
108+
with:
109+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)