Skip to content

Commit 390b653

Browse files
committed
ci; docs
1 parent 8239b37 commit 390b653

2 files changed

Lines changed: 78 additions & 18 deletions

File tree

‎.github/workflows/tests-ci.yml‎

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ jobs:
4040
run: uv run --frozen pytest
4141

4242

43-
# Older pythons, down to the oldest one that the GitHub-hosted runners can
44-
# still provide. 'uv.lock' deliberately covers python 3.10 and later only
45-
# (see [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved
46-
# on the fly here and uv picks whichever release still supports the
47-
# interpreter. These runs are therefore not pinned; a pytest release could
48-
# in principle break them without any change on our side.
43+
# Older pythons that the runner images still provide an interpreter for.
44+
# 'uv.lock' deliberately covers python 3.10 and later only (see
45+
# [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved on the
46+
# fly here and uv picks whichever release still supports the interpreter.
47+
# These runs are therefore not pinned; a pytest release could in principle
48+
# break them without any change on our side.
4949
#
5050
# The library is pure python and has no runtime dependencies, so there is
5151
# nothing to build: it is used straight from the source tree via PYTHONPATH.
@@ -55,15 +55,15 @@ jobs:
5555
#fail-fast: true
5656
matrix:
5757
python-version:
58-
- "3.7"
5958
- "3.8"
6059
- "3.9"
6160

62-
# 'ubuntu-22.04' is the newest runner image for which 'actions/setup-python'
63-
# still provides python 3.7. uv's own python downloads only start at 3.8,
64-
# which is why the interpreter comes from 'actions/setup-python' here and
65-
# from 'astral-sh/setup-uv' in the job above.
66-
runs-on: 'ubuntu-22.04'
61+
# 'actions/setup-python' publishes prebuilt interpreters per runner image.
62+
# For python 3.8 and 3.9 the newest image it builds them for is ubuntu
63+
# 24.04, so that is what we ask for rather than 'ubuntu-latest' — the
64+
# 'latest' label moves on to newer images over time and would eventually
65+
# leave these two versions behind without warning.
66+
runs-on: 'ubuntu-24.04'
6767

6868
steps:
6969
- uses: actions/checkout@v4
@@ -87,3 +87,58 @@ jobs:
8787
run: >-
8888
uv run --no-project --python "$(which python)" --with pytest
8989
pytest
90+
91+
92+
# The two oldest pythons we still advertise, run inside the official docker
93+
# images for those versions.
94+
#
95+
# These cannot go through 'actions/setup-python' at all. That action installs
96+
# interpreters that were prebuilt for a specific runner image, and the newest
97+
# image python 3.6 was ever built for is ubuntu 20.04, which has been retired;
98+
# for python 3.7 it is ubuntu 22.04, whose retirement is already scheduled.
99+
# Building these versions from source instead (with pyenv, say) runs into a
100+
# second wall: ubuntu 22.04 and later ship OpenSSL 3, which python 3.6
101+
# predates, so its secure-sockets module will not compile without supplying an
102+
# older OpenSSL first.
103+
#
104+
# The official images sidestep both problems. They stopped being updated when
105+
# each version reached end of life, which is exactly what we want here: a
106+
# frozen, genuine interpreter of that vintage.
107+
#
108+
# Note the container is used for the test step only, rather than as a
109+
# job-level 'container:'. Anything declared that way makes GitHub run its own
110+
# tooling inside the image, and that tooling needs a newer system C library
111+
# than these old images carry. Checking out on the runner and mounting the
112+
# working directory keeps all of that on the host, where it is fine, and
113+
# leaves the container with nothing to do but install pytest and run it.
114+
tests-ci-oldest:
115+
116+
strategy:
117+
#fail-fast: true
118+
matrix:
119+
# Full versions, because they name the image tag: these are the final
120+
# releases of each series, and no further ones are coming.
121+
python-version:
122+
- "3.6.15"
123+
- "3.7.17"
124+
125+
runs-on: 'ubuntu-latest'
126+
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
# pytest is left unpinned for the same reason as in the job above. pip
131+
# honours each release's declared python requirement, so this settles on
132+
# pytest 7.0.1 under python 3.6 (7.1 was the first to drop it) and on the
133+
# last 7.x supporting python 3.7.
134+
#
135+
# Writing no bytecode keeps the container from leaving root-owned '.pyc'
136+
# files behind in the mounted working directory.
137+
- name: 'Run tests on python ${{ matrix.python-version }}'
138+
run: |
139+
docker run --rm \
140+
--volume "$PWD:/src" \
141+
--workdir /src \
142+
--env PYTHONDONTWRITEBYTECODE=1 \
143+
"python:${{ matrix.python-version }}-slim" \
144+
sh -c 'pip install --quiet --no-cache-dir --disable-pip-version-check pytest && python -m pytest'

‎doc/new-in-pylatexenc-3.rst‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ architecture with extended and more flexible functionality:
3131

3232
- New parsing mechanism in a new `latexnodes` module — everything gets delegated
3333
to "parser objects" that are specialized in parsing a specific construct. See
34-
:py:class:`pylatexenc.latexnodes.parsers.LatexParserBase`.
35-
36-
- The parser has new enhanced handling of macro, environment, and specials
37-
arguments. Arguments can be named for easier lookup when traversing the node
38-
tree.
34+
:py:class:`pylatexenc.latexnodes.parsers.LatexParserBase`. The reusable
35+
parsers live in `pylatexenc.latexnodes.parsers`; you can write your own by
36+
deriving from `LatexParserBase`.
3937

4038
- Lists of latex node objects
4139
(:py:class:`~pylatexenc.latexnodes.nodes.LatexNode`) are now wrapped in a
4240
special object for node lists →
4341
:py:class:`pylatexenc.latexnodes.nodes.LatexNodeList`.
4442

45-
- Macro, environment and specials arguments are now stored in a
43+
- The parser has new enhanced handling of macro, environment, and specials
44+
arguments. Arguments can be named for easier lookup when traversing the node
45+
tree. Also, macro, environment and specials arguments are now stored in a
4646
:py:class:`pylatexenc.latexnodes.ParsedArguments` object. (The name
4747
`macrospec.ParsedMacroArgs` still refers to that same class, so existing
4848
`isinstance()` tests keep working.) Use
@@ -56,6 +56,11 @@ architecture with extended and more flexible functionality:
5656
argument types, see :py:class:`~pylatexenc.macrospec.MacroSpec` and
5757
:py:class:`~pylatexenc.latexnodes.parsers.LatexStandardArgumentParser`.
5858

59+
- Parsing state changes are described by explicit *parsing state delta* objects
60+
(:py:class:`~pylatexenc.latexnodes.ParsingStateDelta`, so a construct can now
61+
legitimately alter how the rest of the document is parsed — including
62+
extending the macro database mid-document.
63+
5964
- Errors got their own little hierarchy. `LatexWalkerParseError` now derives
6065
from a new
6166
:py:class:`~pylatexenc.latexnodes.LatexWalkerLocatedError`, and the walker

0 commit comments

Comments
 (0)