Skip to content

Python 3.14 support, drop 3.9/3.10; ruff#542

Open
dpausp wants to merge 16 commits intomainfrom
ts-py314-ruff
Open

Python 3.14 support, drop 3.9/3.10; ruff#542
dpausp wants to merge 16 commits intomainfrom
ts-py314-ruff

Conversation

@dpausp
Copy link
Copy Markdown
Member

@dpausp dpausp commented Mar 30, 2026

  • Drop support for Python 3.8 and 3.9.
  • Support Python 3.13 and 3.14.
  • Buildout and Python components: remove obsolete check_package_is_module workaround.
  • Replace pkg_resources with importlib.metadata.
  • Supervisor: bump zc.buildout to 5.1.1 version.
  • Replace isort and black with ruff and reformat everything
  • fix build problems caused by leftover GPG agent sockets
  • Reduce dependencies by dropping tox-extra and using tox-uv-bare which uses pre-installed uv

Covers PRs #529, #531 and #541 which can be closed after merging this.

dpausp and others added 16 commits March 27, 2026 14:40
Python 3.14 raises RuntimeError when calling asyncio.get_event_loop()
without an existing loop.
- Github Workflows
- Tox envs
- Readthedocs uses Python 3.14
Python 3.14 changed ast.literal_eval() error messages from
"<ast.Name object at 0x...>" to "Name(id='...', ctx=...)".
Updated the Ellipsis pattern to be flexible enough to match both formats.
Python 3.14 argparse uses color and emits ANSI codes.
Set NO_COLOR=1 in test to get plain text output.
24 instead of 26 because I do not want to run in any more compatibility
issues
example got reformatted by ruff so line numbers in expected trace back
didn't match anymore. Replace the line number by an ellipsis to avoid
that.
importlib.resources needs a fix for Python 3.10/3.11: use __package__ instead of __name__

In Python < 3.12, importlib.resources.files() only accepts packages, not modules.
__name__ was 'batou.lib.logrotate' (module), __package__ is 'batou.lib' (package).

importlib_metadata and importlib_resources deps can be dropped as we require Python 3.10+ now.
This was a workaround for a very old pip issue.
tox-uv-bare supports Python 3.10+ only, so we couldn't use it before.

tox-extra pulls in a lot of deps, including uv which tox-uv-bare avoids.

Devs can still choose to install tox globally, for example:

uv tool install tox --with tox-extra
hatchling fails when it encounters socket files while building a wheel.

- GPG agent socket files now created in temp dirs, auto-cleaned
- Add gpg_home fixture to all GPG-using tests
- Remove obsolete cleanup code
- Kill gpg-agent after test session to prevent leftover processes
This hurts readability for pytest output and is not needed anymore as
tests expecting a fixed screen width have been adapted.
@dpausp dpausp marked this pull request as ready for review March 30, 2026 02:15
@dpausp dpausp requested a review from zagy as a code owner March 30, 2026 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants