Skip to content

Commit 5cd87d6

Browse files
wu-shengclaude
andcommitted
feat: support Python 3.10-3.14, drop 3.8/3.9
- 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>
1 parent b91ebc4 commit 5cd87d6

File tree

9 files changed

+3235
-2499
lines changed

9 files changed

+3235
-2499
lines changed

.github/workflows/CI.yaml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ jobs:
4545
- name: Set up Python
4646
uses: actions/setup-python@v5
4747
with:
48-
python-version: 3.8
48+
python-version: "3.11"
4949
- name: Lint codes
5050
run: |
51-
make env
51+
make poetry
52+
poetry install --all-extras --with lint
53+
make gen
5254
make lint
5355
5456
# Check if the plugin doc is generated correctly
@@ -65,7 +67,7 @@ jobs:
6567
- name: Set up Python
6668
uses: actions/setup-python@v5
6769
with:
68-
python-version: 3.8
70+
python-version: "3.14"
6971
- name: Check plugin doc
7072
run: |
7173
make env
@@ -86,10 +88,9 @@ jobs:
8688
with:
8789
persist-credentials: false
8890
- name: Check for file changes
89-
uses: getsentry/paths-filter@v2.11.1
91+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
9092
id: filter
9193
with:
92-
token: ${{ github.token }}
9394
# The following filters indicate a category along with
9495
# the files that should not be ignored by CI when modified.
9596
filters: |
@@ -138,7 +139,7 @@ jobs:
138139
runs-on: ubuntu-latest
139140
strategy:
140141
matrix: # may support pypy in the future
141-
python-version: [ "3.8-slim", "3.9-slim", "3.10-slim", "3.11-slim" ]
142+
python-version: [ "3.10-slim", "3.11-slim", "3.12-slim", "3.13-slim", "3.14-slim" ]
142143
fail-fast: false
143144
env:
144145
BASE_PYTHON_IMAGE: ${{ matrix.python-version }}
@@ -171,7 +172,7 @@ jobs:
171172
timeout-minutes: 20
172173
strategy:
173174
matrix:
174-
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
175+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
175176
test-path: ${{fromJson(needs.prep-plugin-and-unit-tests.outputs.matrix)}}
176177
fail-fast: false
177178
env:
@@ -205,7 +206,9 @@ jobs:
205206
python-version: ${{ matrix.python-version }}
206207
- name: Run unit tests
207208
run: |
208-
make env
209+
make poetry
210+
poetry install --all-extras --without plugins,lint
211+
make gen
209212
poetry run pytest -v ${{ matrix.test-path }}
210213
211214
docker-e2e:
@@ -219,7 +222,7 @@ jobs:
219222
timeout-minutes: 10
220223
strategy:
221224
matrix:
222-
python-image-variant: [ "3.8-slim", "3.9-slim", "3.10-slim", "3.11-slim" ]
225+
python-image-variant: [ "3.10-slim", "3.11-slim", "3.12-slim", "3.13-slim", "3.14-slim" ]
223226
fail-fast: false
224227
env:
225228
BASE_PYTHON_IMAGE: ${{ matrix.python-image-variant }}
@@ -251,7 +254,7 @@ jobs:
251254
timeout-minutes: 20
252255
strategy:
253256
matrix:
254-
python-image-variant: [ "3.8-slim", "3.9-slim", "3.10-slim", "3.11-slim" ]
257+
python-image-variant: [ "3.10-slim", "3.11-slim", "3.12-slim", "3.13-slim", "3.14-slim" ]
255258
case:
256259
- name: gRPC-single-process
257260
path: tests/e2e/case/grpc/single/e2e.yaml

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ endif
5252

5353
.PHONY: gen
5454
gen:
55-
poetry run pip install grpcio-tools==1.68.0 packaging
55+
poetry run pip install 'grpcio-tools>=1.68.0' packaging
5656
poetry run python3 tools/grpc_code_gen.py
5757

5858
.PHONY: gen-basic
5959
gen-basic:
60-
python3 -m pip install grpcio-tools==1.68.0 packaging
60+
python3 -m pip install 'grpcio-tools>=1.68.0' packaging
6161
python3 tools/grpc_code_gen.py
6262

6363
.PHONY: install
@@ -97,7 +97,7 @@ license: clean
9797
.PHONY: test
9898
test: env
9999
sudo apt-get -y install jq
100-
docker build --build-arg BASE_PYTHON_IMAGE=3.8-slim -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
100+
docker build --build-arg BASE_PYTHON_IMAGE=3.11-slim -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
101101
poetry run pytest -v $(bash tests/gather_test_paths.sh)
102102

103103
.PHONY: package

docker/Makefile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,40 @@ D := docker
2121

2222
P := grpc http kafka
2323

24-
TARGETS := py3.8 py3.9 py3.10 py3.8-slim py3.9-slim py3.10-slim
24+
TARGETS := py3.10 py3.11 py3.12 py3.13 py3.14 py3.10-slim py3.11-slim py3.12-slim py3.13-slim py3.14-slim
2525

26-
py3.8: BASE_PYTHON_IMAGE = python:3.8
27-
py3.9: BASE_PYTHON_IMAGE = python:3.9
2826
py3.10: BASE_PYTHON_IMAGE = python:3.10
2927
py3.11: BASE_PYTHON_IMAGE = python:3.11
30-
py3.8-slim: BASE_PYTHON_IMAGE = python:3.8-slim
31-
py3.9-slim: BASE_PYTHON_IMAGE = python:3.9-slim
28+
py3.12: BASE_PYTHON_IMAGE = python:3.12
29+
py3.13: BASE_PYTHON_IMAGE = python:3.13
30+
py3.14: BASE_PYTHON_IMAGE = python:3.14
3231
py3.10-slim: BASE_PYTHON_IMAGE = python:3.10-slim
3332
py3.11-slim: BASE_PYTHON_IMAGE = python:3.11-slim
33+
py3.12-slim: BASE_PYTHON_IMAGE = python:3.12-slim
34+
py3.13-slim: BASE_PYTHON_IMAGE = python:3.13-slim
35+
py3.14-slim: BASE_PYTHON_IMAGE = python:3.14-slim
3436

35-
push-py3.8: BASE_PYTHON_IMAGE = python:3.8
36-
push-py3.9: BASE_PYTHON_IMAGE = python:3.9
3737
push-py3.10: BASE_PYTHON_IMAGE = python:3.10
3838
push-py3.11: BASE_PYTHON_IMAGE = python:3.11
39-
push-py3.8-slim: BASE_PYTHON_IMAGE = python:3.8-slim
40-
push-py3.9-slim: BASE_PYTHON_IMAGE = python:3.9-slim
39+
push-py3.12: BASE_PYTHON_IMAGE = python:3.12
40+
push-py3.13: BASE_PYTHON_IMAGE = python:3.13
41+
push-py3.14: BASE_PYTHON_IMAGE = python:3.14
4142
push-py3.10-slim: BASE_PYTHON_IMAGE = python:3.10-slim
4243
push-py3.11-slim: BASE_PYTHON_IMAGE = python:3.11-slim
44+
push-py3.12-slim: BASE_PYTHON_IMAGE = python:3.12-slim
45+
push-py3.13-slim: BASE_PYTHON_IMAGE = python:3.13-slim
46+
push-py3.14-slim: BASE_PYTHON_IMAGE = python:3.14-slim
4347

44-
push-py3.8: BUILDER_PYTHON_IMAGE = python:3.8
45-
push-py3.9: BUILDER_PYTHON_IMAGE = python:3.9
4648
push-py3.10: BUILDER_PYTHON_IMAGE = python:3.10
4749
push-py3.11: BUILDER_PYTHON_IMAGE = python:3.11
48-
push-py3.8-slim: BUILDER_PYTHON_IMAGE = python:3.8
49-
push-py3.9-slim: BUILDER_PYTHON_IMAGE = python:3.9
50+
push-py3.12: BUILDER_PYTHON_IMAGE = python:3.12
51+
push-py3.13: BUILDER_PYTHON_IMAGE = python:3.13
52+
push-py3.14: BUILDER_PYTHON_IMAGE = python:3.14
5053
push-py3.10-slim: BUILDER_PYTHON_IMAGE = python:3.10
5154
push-py3.11-slim: BUILDER_PYTHON_IMAGE = python:3.11
55+
push-py3.12-slim: BUILDER_PYTHON_IMAGE = python:3.12
56+
push-py3.13-slim: BUILDER_PYTHON_IMAGE = python:3.13
57+
push-py3.14-slim: BUILDER_PYTHON_IMAGE = python:3.14
5258

5359
PUSH_TARGETS := $(TARGETS:%=push-%)
5460

docs/en/setup/Container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
source**
55

66
This image hosts the SkyWalking Python agent package on top of official Python base images (full & slim) providing support from
7-
Python 3.8 - 3.11.
7+
Python 3.10 - 3.14.
88

99
## How to use this image
1010

0 commit comments

Comments
 (0)