Skip to content

Drop support for Python <3.11, test up to 3.15 - #390

Merged
dividedmind merged 2 commits into
masterfrom
chore/python-3.11-3.15
Nov 10, 2026
Merged

dividedmind merged 2 commits into
masterfrom
chore/python-3.11-3.15

Conversation

@dividedmind

Copy link
Copy Markdown
Contributor

To make this work in newer pythons, fix a bug where imports are reentered when building the filter chain. Additionally, run tests with django6 and drop some old python version compatibility code that's no longer needed.

@dividedmind
dividedmind requested review from kgilpin and a balanced review from Copilot November 9, 2026 19:16
@dividedmind dividedmind self-assigned this Nov 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Modules imported during filter construction can permanently escape instrumentation, while the Python 3.15 CI job fails interpreter setup because prerelease resolution is disabled.

2 open issues
What changed in this PR

Raises AppMap’s minimum Python version to 3.11 and extends compatibility testing through Python 3.15, including Django 6.

Changes:

  • Updates package metadata, runtime checks, and test matrices for the supported Python versions.
  • Adds a filter-construction reentry guard to address imports triggered during initialization.
  • Removes obsolete compatibility branches and updates related tests and documentation.
File Description
tox.ini Expands Python and Django test environments and updates dependencies.
README.md Updates the test example to Python 3.11.
pyproject.toml Raises the Python minimum and updates compatibility classifiers.
pylintrc Sets Python 3.11 as the linting baseline.
appmap/​command/​runner.py Removes the legacy argument-parser fallback.
.github/​workflows/​lint-and-test.yml Changes the Python matrix to 3.11–3.15.
_appmap/​test/​test_properties.py Enables the operator class assertion.
_appmap/​test/​test_params.py Removes obsolete version-based test skips.
_appmap/​test/​test_command.py Updates unsupported-version checks and error matching.
_appmap/​py_version_check.py Enforces Python 3.11 as the runtime minimum.
_appmap/​importer.py Guards filter construction against reentry and simplifies finder wrapping.
_appmap/​configuration.py Uses is_relative_to for output-directory handling.

Review effort: Balanced

Comment thread .github/workflows/lint-and-test.yml Resolved
Comment thread _appmap/importer.py Resolved
The filter chain used to be built lazily, on the first import that went
through our finder hooks. Building it creates a DistMatcher for each
`dist:` entry in appmap.yml, which calls importlib.metadata.files(). On
Python 3.13+ that imports csv lazily; the import went through our hooks
back into do_import, which started building the chain again, and the
nested files() call then found csv partially initialized. With process
recording enabled this happened while processing appmap.pth, aborting
interpreter startup.

Build the chain eagerly instead, once the configuration has registered
its filters, and only then hook the finders, so nothing imported while
building it can reach the hooks. This also avoids two latent problems
with the lazy build: an import between hooking and filter registration
would have cached an empty chain, and Importer.instrument_function
(used by the FastAPI integration) assumed the chain already existed.

Assisted-by: Claude:claude-opus-5-5
Python 3.8-3.10 have reached end of life, and ubuntu-latest no longer
provides 3.9.14 at all. Raise requires-python to >=3.11 and test on
3.11 through 3.15.

- Drop compatibility code for older versions: the BooleanOptionalAction
  fallback, the pre-3.11 find_spec wrapping, the relative_to workaround
  for missing is_relative_to, and version-gated tests and deps.
- Fix test_python_version's regex, which couldn't match a two-digit
  minor version.
- tox: run the web env against Django 5.2 LTS (Django 4.2 breaks on
  3.14), add a django6 env for 3.12+, and limit django3/django4 to
  3.11-3.12, the newest Pythons they support.
- Add Python and Django version classifiers.

BREAKING CHANGE: Python 3.8, 3.9 and 3.10 are no longer supported.

Assisted-by: Claude:claude-opus-5-5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review identifies no active issues in the Python compatibility updates or import-filter initialization changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@dividedmind
dividedmind merged commit f40aace into master Nov 10, 2026
8 checks passed
@dividedmind
dividedmind deleted the chore/python-3.11-3.15 branch November 10, 2026 17:23
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