Skip to content

Commit 8d60b8b

Browse files
committed
ci: stabilize GitHub Actions workflows on openSUSE Leap 15.6
- Cleaned up .github/posix-deps-zypp.sh dependencies: - Replaced non-existent 'lzma' and 'lzma-devel' with 'xz-devel'. - Changed 'uuid-devel' to the standard 'libuuid-devel'. - Removed duplicate package declarations (libffi-devel, xvfb-run). - Reorganized .github/ directory structure: - Moved posix-deps-zypp.sh from .github/workflows/ to .github/. - Updated build.yml and doc.yml to reference the new path. - Re-enabled 'generated-files' task: - Removed the 'if: false' overrides on the generated files steps. - Modernized verify-ensurepip-wheels.yml: - Upgraded actions versions to checkout@v4 and setup-python@v5. - Made the script execution explicitly use python3.
1 parent 4bf3317 commit 8d60b8b

14 files changed

Lines changed: 300 additions & 59 deletions

‎.github/posix-deps-zypp.sh‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
zypper --non-interactive refresh
5+
6+
# The container can have newer libraries than the repositories' matching -devel
7+
# packages. Allow the solver to downgrade dependencies rather than cancel.
8+
# Install build tools explicitly: build patterns pull in a full base system,
9+
# including packages that conflict with the container's busybox replacements.
10+
# Python 3.6 needs OpenSSL 1.1 headers rather than Leap's default OpenSSL 3.
11+
zypper --non-interactive install --auto-agree-with-licenses \
12+
--allow-downgrade --no-recommends \
13+
autoconf automake gcc gcc-c++ make patch pkg-config python3 \
14+
binutils diffutils findutils gdb gzip libtool perl tar which \
15+
libabigail-tools xorg-x11-server-Xvfb xvfb-run \
16+
cantarell-fonts google-droid-fonts google-inconsolata-fonts dejavu-fonts \
17+
libffi-devel \
18+
xz-devel \
19+
bzip2 \
20+
zlib-devel \
21+
libbz2-devel \
22+
ncurses-devel \
23+
readline-devel \
24+
sqlite3-devel \
25+
libopenssl-1_1-devel \
26+
gdbm-devel \
27+
tk-devel \
28+
libuuid-devel \
29+
lcov

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/checkout@v4
6161

6262
- name: Install All Dependencies
63-
run: sh -x ./.github/workflows/posix-deps-zypp.sh
63+
run: sh -x ./.github/posix-deps-zypp.sh
6464

6565
- name: 'Restore OpenSSL build'
6666
if: matrix.task == 'build-and-test'
@@ -85,15 +85,13 @@ jobs:
8585

8686
# === Steps for Generated Files Check ===
8787
- name: Build CPython for Generated Files Check
88-
# if: matrix.task == 'generated-files'
89-
if: false
88+
if: matrix.task == 'generated-files'
9089
run: |
9190
./configure --with-pydebug
9291
make -j4 regen-all
9392
9493
- name: Check for changes in generated files
95-
# if: matrix.task == 'generated-files'
96-
if: false
94+
if: matrix.task == 'generated-files'
9795
run: |
9896
if ! git diff --quiet; then
9997
echo "Generated files are not up to date. Please run 'make regen-all' and commit the changes."
@@ -103,8 +101,7 @@ jobs:
103101
fi
104102
105103
- name: Check exported libpython symbols
106-
# if: matrix.task == 'generated-files'
107-
if: false
104+
if: matrix.task == 'generated-files'
108105
run: make smelly
109106

110107
# === Steps for Full Build and Test ===

‎.github/workflows/doc.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- uses: actions/checkout@v4
2929

3030
- name: 'Install Dependencies'
31-
run: ./.github/workflows/posix-deps-zypp.sh
31+
run: sh ./.github/posix-deps-zypp.sh
3232
# apt-get install wamerican
3333

3434
- name: 'Configure CPython'

‎.github/workflows/posix-deps-zypp.sh‎

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

‎.github/workflows/verify-ensurepip-wheels.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
verify:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-python@v4
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-python@v5
2525
with:
2626
python-version: '3'
2727
- name: Compare checksums of bundled pip and setuptools to ones published on PyPI
28-
run: ./Tools/scripts/verify_ensurepip_wheels.py
28+
run: python3 ./Tools/scripts/verify_ensurepip_wheels.py

‎Doc/Makefile‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
PYTHON = python3
88
VENVDIR = ./venv
99
SPHINXBUILD = PATH=$(VENVDIR)/bin:$$PATH sphinx-build
10-
BLURB = PATH=$(VENVDIR)/bin:$$PATH blurb
10+
BLURB = $(VENVDIR)/bin/python3 $(VENVDIR)/blurb.py
1111
PAPER =
1212
SOURCES =
1313
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
@@ -49,7 +49,6 @@ build:
4949
cp ../Misc/NEWS build/NEWS; \
5050
elif [ -d ../Misc/NEWS.d ]; then \
5151
echo "Building NEWS from Misc/NEWS.d with blurb"; \
52-
$(BLURB) --version; \
5352
$(BLURB) merge -f build/NEWS; \
5453
else \
5554
echo "Neither Misc/NEWS.d nor Misc/NEWS found; cannot build docs"; \
@@ -124,8 +123,10 @@ clean:
124123

125124
venv:
126125
$(PYTHON) -m venv $(VENVDIR)
127-
$(VENVDIR)/bin/python3 -m pip install -U Sphinx==2.3.1 \
128-
git+https://github.com/python/blurb.git@3696908d9621d284837715d6f1db7cc167be7514
126+
$(VENVDIR)/bin/python3 -m pip install -r requirements.txt
127+
# Patch a private copy, leaving the installed package unchanged.
128+
cp "$$($(VENVDIR)/bin/python3 -c 'import blurb; print(blurb.__file__)')" $(VENVDIR)/blurb.py
129+
patch --batch $(VENVDIR)/blurb.py tools/blurb-gh-issues.patch
129130
@echo "The venv has been created in the $(VENVDIR) directory"
130131

131132
dist:

‎Doc/README.rst‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,21 @@ build the HTML output files::
3939

4040
make html
4141

42-
By default, if the virtual environment is not created, the Makefile will
43-
look for instances of sphinxbuild and blurb installed on your process PATH
44-
(configurable with the SPHINXBUILD and BLURB variables).
42+
This branch pins the Python tools in ``requirements.txt`` for Python 3.6.
43+
The ``venv`` target also requires GNU ``patch``. It copies blurb 1.0.7 to
44+
``venv/blurb.py`` and applies ``tools/blurb-gh-issues.patch`` to that private
45+
copy so NEWS generation accepts both Roundup and GitHub issue numbers.
46+
The installed blurb package and NEWS fragments are not modified. Repeating
47+
``make venv`` recreates the patched copy from the installed package.
48+
49+
The Makefile looks for Sphinx in the virtual environment and then on PATH.
50+
It uses the private blurb copy by default. Override ``SPHINXBUILD`` or ``BLURB``
51+
to use other tools; an external blurb must support GitHub issue entries.
52+
53+
To run the documentation-tool regression tests::
54+
55+
venv/bin/python3 tools/test_blurb.py
56+
venv/bin/python3 tools/test_extensions.py
4557

4658
On Windows, we try to emulate the Makefile as closely as possible with a
4759
``make.bat`` file. If you need to specify the Python interpreter to use,

‎Doc/library/tarfile.rst‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ be finalized; only the internally used file object will be closed. See the
491491
Return an :class:`io.BufferedReader` object.
492492

493493
.. attribute:: TarFile.errorlevel
494-
:type: int
494+
:annotation: : int
495495

496496
If *errorlevel* is ``0``, errors are ignored when using :meth:`TarFile.extract`
497497
and :meth:`TarFile.extractall`.
@@ -676,19 +676,19 @@ A ``TarInfo`` object has the following public data attributes:
676676

677677

678678
.. attribute:: TarInfo.name
679-
:type: str
679+
:annotation: : str
680680

681681
Name of the archive member.
682682

683683

684684
.. attribute:: TarInfo.size
685-
:type: int
685+
:annotation: : int
686686

687687
Size in bytes.
688688

689689

690690
.. attribute:: TarInfo.mtime
691-
:type: int | float
691+
:annotation: : int | float
692692

693693
Time of last modification in seconds since the :ref:`epoch <epoch>`,
694694
as in :attr:`os.stat_result.st_mtime`.
@@ -700,7 +700,7 @@ A ``TarInfo`` object has the following public data attributes:
700700
attribute.
701701

702702
.. attribute:: TarInfo.mode
703-
:type: int
703+
:annotation: : int
704704

705705
Permission bits, as for :func:`os.chmod`.
706706

@@ -720,14 +720,14 @@ A ``TarInfo`` object has the following public data attributes:
720720

721721

722722
.. attribute:: TarInfo.linkname
723-
:type: str
723+
:annotation: : str
724724

725725
Name of the target file name, which is only present in :class:`TarInfo` objects
726726
of type :const:`LNKTYPE` and :const:`SYMTYPE`.
727727

728728

729729
.. attribute:: TarInfo.uid
730-
:type: int
730+
:annotation: : int
731731

732732
User ID of the user who originally stored this member.
733733

@@ -738,7 +738,7 @@ A ``TarInfo`` object has the following public data attributes:
738738
attribute.
739739

740740
.. attribute:: TarInfo.gid
741-
:type: int
741+
:annotation: : int
742742

743743
Group ID of the user who originally stored this member.
744744

@@ -749,7 +749,7 @@ A ``TarInfo`` object has the following public data attributes:
749749
attribute.
750750

751751
.. attribute:: TarInfo.uname
752-
:type: str
752+
:annotation: : str
753753

754754
User name.
755755

@@ -760,7 +760,7 @@ A ``TarInfo`` object has the following public data attributes:
760760
attribute.
761761

762762
.. attribute:: TarInfo.gname
763-
:type: str
763+
:annotation: : str
764764

765765
Group name.
766766

@@ -771,7 +771,7 @@ A ``TarInfo`` object has the following public data attributes:
771771
attribute.
772772

773773
.. attribute:: TarInfo.pax_headers
774-
:type: dict
774+
:annotation: : dict
775775

776776
A dictionary containing key-value pairs of an associated pax extended header.
777777

‎Doc/requirements.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Sphinx==2.3.1
2+
blurb==1.0.7
3+
4+
# docutils 0.18's meta node conflicts with Sphinx 2.3.1 under -W.
5+
docutils==0.15.2

‎Doc/tools/blurb-gh-issues.patch‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
Backport GitHub issue support for NEWS reading and merging to blurb 1.0.7.
2+
Based on upstream commit a2e8eeca0c72343fb30e67aaf33a6f0c1db440b1:
3+
https://github.com/python/blurb/commit/a2e8eeca0c72343fb30e67aaf33a6f0c1db440b1
4+
5+
Keep Python 3.6 and pip 18.1 support. Only the documentation build's private
6+
copy is patched; the installed blurb package and NEWS fragments are unchanged.
7+
8+
--- a/blurb.py
9+
+++ b/blurb.py
10+
@@ -1,6 +1,6 @@
11+
#!/usr/bin/env python3
12+
"""Command-line tool to manage CPython Misc/NEWS.d entries."""
13+
-__version__ = "1.0.7"
14+
+__version__ = "1.0.7+gh"
15+
16+
##
17+
## blurb version 1.0
18+
@@ -468,7 +468,7 @@
19+
if not body:
20+
throw("Blurb 'body' text must not be empty!")
21+
text = textwrap_body(body)
22+
- for naughty_prefix in ("- ", "Issue #", "bpo-"):
23+
+ for naughty_prefix in ("- ", "Issue #", "bpo-", "gh-", "gh-issue-"):
24+
if text.startswith(naughty_prefix):
25+
throw("Blurb 'body' can't start with " + repr(naughty_prefix) + "!")
26+
27+
@@ -481,11 +481,12 @@
28+
elif section not in sections:
29+
throw("Invalid 'section'! You must use one of the predefined sections.")
30+
31+
- bpo = None
32+
+ issue_kind = 'gh-issue' if 'gh-issue' in metadata else 'bpo'
33+
+ issue_number = metadata.get(issue_kind)
34+
try:
35+
- bpo = int(metadata.get('bpo'))
36+
+ int(issue_number)
37+
except (TypeError, ValueError):
38+
- throw("Invalid bpo issue number! (" + repr(bpo) + ")")
39+
+ throw("Invalid " + issue_kind + " issue number! (" + repr(issue_number) + ")")
40+
41+
self.append((metadata, text))
42+
metadata = {}
43+
@@ -568,7 +569,7 @@
44+
metadata = {"date": fields[0], "nonce": fields[-2], "section": section}
45+
46+
for field in fields[1:-2]:
47+
- for name in ("bpo",):
48+
+ for name in ("gh-issue", "bpo"):
49+
_, got, value = field.partition(name + "-")
50+
if got:
51+
metadata[name] = value.strip()
52+
@@ -1094,9 +1095,10 @@
53+
print("-" * len(section))
54+
print()
55+
56+
- bpo = metadata['bpo']
57+
- if int(bpo):
58+
- body = "bpo-" + bpo + ": " + body
59+
+ issue_kind = 'gh-issue' if 'gh-issue' in metadata else 'bpo'
60+
+ issue_number = metadata[issue_kind]
61+
+ if int(issue_number):
62+
+ body = issue_kind + "-" + issue_number + ": " + body
63+
body = "- " + body
64+
text = textwrap_body(body, subsequent_indent=' ')
65+
print(text)

0 commit comments

Comments
 (0)