Skip to content

Run on Python 3.12, 3.13 and 3.14 - #256

Draft
maxipavlovic wants to merge 4 commits into
masterfrom
fix/python-3.12-to-3.14
Draft

maxipavlovic wants to merge 4 commits into
masterfrom
fix/python-3.12-to-3.14

Conversation

@maxipavlovic

Copy link
Copy Markdown
Member

What

  • Plugins load on Python 3.12 and newer: the CLI selects its entry point group with entry_points(group=...) instead of the dict API that Python 3.12 removed. The unused distutils import goes too.
  • The version check behind ccli --version gives up after 5 seconds.
  • flake8-string-format 0.3 → 0.4, and flake8-future-import goes: both broke on Python 3.14. No other locked version changes.
  • CI tests Python 3.10–3.14 on Linux, and 3.10 and 3.14 on macOS. The classifiers now come from the python range, so 3.8 and 3.9 are no longer listed.

Why

41.0 says it supports Python 3.10–3.14, but on 3.12 and newer every command, --help included, fails with AttributeError: 'EntryPoints' object has no attribute 'get'. pip and uv install it there without a warning, and CI only tested 3.10. It also keeps the Homebrew formula on python@3.10, which Homebrew disables on 1 Oct 2027.

Key decisions

How it worked before / after

  • Before: works on Python 3.10 and 3.11 only.
  • After: works on 3.10–3.14. Locally, all 721 tests pass on 3.10, 3.11, 3.12 and 3.14, and on 3.13 with the client fix installed from its branch.

Since Python 3.12, importlib.metadata.entry_points() no longer returns a
dict, so entry_points().get(group) raised AttributeError and every ccli
command failed, --help included. Select the group instead, which works on
Python 3.10 and newer.

Also drop the unused distutils import: distutils is gone in Python 3.12 and
only resolved through setuptools' shim.

A new test reads the plugins that are actually installed, so a change like
this one can't go unnoticed again.
ccli --version asks Connect and PyPI for the latest versions without a
timeout, so a slow network made it hang. The check is best effort and already
ignores request errors, so a timeout now ends it quietly.
Python 3.14 removed ast.Str, so flake8 could not load two plugins and the
extension project tests failed:

- flake8-string-format moves to 0.4, which supports Python 3.14.
- flake8-future-import goes. Its last release is from 2022, and its checks
  did nothing here: they are on the ignore list, and code that requires
  Python 3.10 needs no __future__ imports.

No other locked version changes.
CI tested Python 3.10 on Linux only, so the Python 3.12 failure above went
unnoticed while the package said it supports 3.10 to 3.14. Test every
supported version on Linux, and the oldest and newest on macOS, where the PDF
reports need Pango from Homebrew.

The classifiers listed Python 3.8 and 3.9, which the package does not
support. Poetry now derives them from the python range.
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.

1 participant