Skip to content

feat: support Python 3.10-3.14, drop 3.8/3.9#386

Open
wu-sheng wants to merge 7 commits intomasterfrom
feat/python-3.12-3.14-support
Open

feat: support Python 3.10-3.14, drop 3.8/3.9#386
wu-sheng wants to merge 7 commits intomasterfrom
feat/python-3.12-3.14-support

Conversation

@wu-sheng
Copy link
Copy Markdown
Member

Summary

  • Fix root cause of PR feat: bump up 3.12 and 3.13 #374 failures: missing import importlib.util in plugin loader caused NameError on Python 3.12+, plus CI test step venv mismatch
  • Drop Python 3.8/3.9 (EOL), add 3.12/3.13/3.14 to CI matrix and Docker images
  • Replace deprecated find_module/load_module with find_spec/module_from_spec across plugin loader and doc generator
  • Mark plugins/lint dependency groups as optional; use >= ranges so poetry lock resolves on newer Python
  • Replace unapproved getsentry/paths-filter GHA with approved dorny/paths-filter
  • Update testcontainers DockerCompose API for v4 compatibility

Key design decisions

  • Plugin group deps changed from exact pins to >= ranges: The exact versions tested per plugin are NOT affected — those are controlled by each plugin's support_matrix dict and enforced via Docker requirements.txt. The pyproject.toml plugin group is only for dev-machine installation.
  • CI test step uses --without plugins,lint: Plugin integration tests run inside Docker containers, so the host only needs pytest + testcontainers. This avoids resolving old plugin deps (e.g., django 3.2, celery 5.1) on Python 3.12+.

Verified locally

Docker images build and agent loads all 35 plugins on Python 3.10, 3.11, 3.12, 3.13, and 3.14:

=== Python 3.10 === Plugins discovered: 35 — SUCCESS
=== Python 3.11 === Plugins discovered: 35 — SUCCESS
=== Python 3.12 === Plugins discovered: 35 — SUCCESS
=== Python 3.13 === Plugins discovered: 35 — SUCCESS
=== Python 3.14 === Plugins discovered: 35 — SUCCESS

Test plan

  • CI plugin tests pass on Python 3.10/3.11 (existing coverage)
  • CI plugin tests pass on Python 3.12/3.13/3.14 (new)
  • E2E tests pass across all Python versions
  • Docker images build for all variants
  • Lint and doc-gen checks pass

Supersedes #374

🤖 Generated with Claude Code

wu-sheng and others added 2 commits April 10, 2026 22:23
- Fix missing `import importlib.util` that caused NameError on Python 3.12+
  (root cause of PR #374 failures)
- Replace deprecated `find_module`/`load_module` with `find_spec`/`module_from_spec`
  in plugin loader and doc generator
- Remove Python <3.8 `pkg_resources` fallback (dead code since 3.8 dropped)
- Update CI matrix: test Python 3.10/3.11/3.12/3.13/3.14
- Fix CI test step: use `--without plugins,lint` to avoid installing
  incompatible old plugin test deps on newer Python versions
  (plugin tests run in Docker, host only needs pytest + testcontainers)
- Mark plugins and lint dependency groups as optional
- Change plugin dep pins from exact versions to `>=` ranges so
  poetry lock resolves on newer Python (actual test versions unchanged,
  controlled by support_matrix in each plugin + Docker)
- Update deps: unpin psutil, loosen wrapt/uvloop/grpcio-tools constraints
- Remove uwsgi from dev deps (doesn't build on 3.12+, tested via e2e)
- Update testcontainers DockerCompose usage for v4 API compatibility
- Replace unapproved getsentry/paths-filter with dorny/paths-filter
- Update docker/Makefile and Container.md for 3.10-3.14

Verified: Docker images build and agent loads all 35 plugins successfully
on Python 3.10, 3.11, 3.12, 3.13, and 3.14.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CLAUDE.md: project guide covering structure, plugin API, testing framework,
  build commands, and CI pipeline
- .claude/skills/new-plugin: scaffolds a complete new instrumentation plugin
  (code, tests, docker-compose, expected data, services)
- .claude/skills/plugin-test: runs plugin/unit tests locally across Python
  versions, mirroring CI pipeline

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wu-sheng wu-sheng added this to the 1.3.0 milestone Apr 10, 2026
@wu-sheng wu-sheng added the enhancement New feature or request label Apr 10, 2026
wu-sheng and others added 5 commits April 10, 2026 22:30
Poetry 1.5.1 cannot read lock files generated by Poetry 2.x,
causing CI lint step to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move imports to top of file and ensure 2 blank lines after function
definition to satisfy flake8 rules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
pylint 2.13.9 incorrectly reports os.getenv as E1101 (no-member)
on newer Python. Allow resolution to a newer version that fixes this.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add newer library versions that support Python 3.12+:
- pyramid: add 2.1 for >=3.12 (requires_python>=3.10)
- kafka-python: add 2.3 for >=3.12 (revived with 3.12/3.13 support)
- pulsar-client: add 3.9.0 for >=3.12 (has cp312/cp313 wheels)
- urllib3: add 2.0 for >=3.12 (2.x series supports 3.12+)
- happybase: keep 1.2.0 for >=3.10 (pure Python, thriftpy2 dep
  may need investigation for 3.12+)

Regenerate Plugins.md via make doc-gen.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gevent/greenlet does not have Python 3.14 wheels yet.
Exclude the profiling_greenlet E2E test from the 3.14 matrix
and document the limitation in Container.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant