Repository navigation
Drop support for Python <3.11, test up to 3.15 - #390
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 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
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
dividedmind
force-pushed
the
chore/python-3.11-3.15
branch
from
November 9, 2026 19:46
792b3e3 to
69cb0a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.