Skip to content

Commit 6711da4

Browse files
authored
feat(python): support Python 3.11 (#129)
1 parent c3f8cca commit 6711da4

File tree

4 files changed

+105
-11
lines changed

4 files changed

+105
-11
lines changed

python/helper-image/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ COPY pydevd_2_9_5.patch ./pydevd.patch
7676
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.10/lib/python3.10/site-packages < pydevd.patch
7777
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.10 pip install --user pydevd-pycharm --no-warn-script-location
7878

79+
FROM python:3.11 as python3_11
80+
RUN PYTHONUSERBASE=/dbgpy pip install --user ptvsd debugpy
81+
RUN PYTHONUSERBASE=/dbgpy/pydevd/python3.11 pip install --user pydevd==2.9.5 --no-warn-script-location
82+
COPY pydevd_2_9_5.patch ./pydevd.patch
83+
RUN patch --binary -p0 -d /dbgpy/pydevd/python3.11/lib/python3.11/site-packages < pydevd.patch
84+
RUN PYTHONUSERBASE=/dbgpy/pydevd-pycharm/python3.11 pip install --user pydevd-pycharm --no-warn-script-location
85+
7986
FROM --platform=$BUILDPLATFORM golang:1.17 as build
8087
ARG BUILDPLATFORM
8188
ARG TARGETOS
@@ -101,4 +108,5 @@ COPY --from=python37 /dbgpy/ python/
101108
COPY --from=python38 /dbgpy/ python/
102109
COPY --from=python39 /dbgpy/ python/
103110
COPY --from=python3_10 /dbgpy/ python/
111+
COPY --from=python3_11 /dbgpy/ python/
104112
COPY --from=build /go/launcher python/

python/skaffold.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,19 @@ profiles:
5555
- op: add
5656
path: /build/artifacts/-
5757
value:
58-
image: python310app
58+
image: python3_10app
5959
context: test/pythonapp
6060
docker:
6161
buildArgs:
6262
PYTHONVERSION: "3.10"
63+
- op: add
64+
path: /build/artifacts/-
65+
value:
66+
image: python3_11app
67+
context: test/pythonapp
68+
docker:
69+
buildArgs:
70+
PYTHONVERSION: "3.11"
6371
- op: add
6472
path: /build/artifacts/-
6573
value:
@@ -69,7 +77,8 @@ profiles:
6977
kubectl:
7078
manifests:
7179
- test/k8s-test-pydevd-python39.yaml
72-
- test/k8s-test-pydevd-python310.yaml
80+
- test/k8s-test-pydevd-python3_10.yaml
81+
- test/k8s-test-pydevd-python3_11.yaml
7382

7483
# release: pushes images to production with :latest
7584
- name: release

python/test/k8s-test-pydevd-python310.yaml renamed to python/test/k8s-test-pydevd-python3_10.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
apiVersion: v1
22
kind: Pod
33
metadata:
4-
name: python310pod
4+
name: python3-10pod
55
labels:
66
app: hello
77
protocol: pydevd
8-
runtime: python310
8+
runtime: python3_10
99
spec:
1010
containers:
11-
- name: python310app
12-
image: python310app
11+
- name: python3-10app
12+
image: python3_10app
1313
command: ["/dbg/python/launcher", "--mode", "pydevd", "--port", "12345", "--"]
1414
args: ["python", "-m", "flask", "run", "--host=0.0.0.0"]
1515
ports:
@@ -41,7 +41,7 @@ spec:
4141
apiVersion: v1
4242
kind: Service
4343
metadata:
44-
name: hello-pydevd-python310
44+
name: hello-pydevd-python3-10
4545
spec:
4646
ports:
4747
- name: http
@@ -53,13 +53,13 @@ spec:
5353
selector:
5454
app: hello
5555
protocol: pydevd
56-
runtime: python310
56+
runtime: python3_10
5757

5858
---
5959
apiVersion: batch/v1
6060
kind: Job
6161
metadata:
62-
name: connect-to-python310
62+
name: connect-to-python3-10
6363
labels:
6464
project: container-debug-support
6565
type: integration-test
@@ -70,8 +70,8 @@ spec:
7070
spec:
7171
restartPolicy: Never
7272
containers:
73-
- name: verify-python310
73+
- name: verify-python3-10
7474
image: pydevconnect
75-
args: ["hello-pydevd-python310:12345"]
75+
args: ["hello-pydevd-python3-10:12345"]
7676

7777

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: python3-11pod
5+
labels:
6+
app: hello
7+
protocol: pydevd
8+
runtime: python3_11
9+
spec:
10+
containers:
11+
- name: python3-11app
12+
image: python3_11app
13+
command: ["/dbg/python/launcher", "--mode", "pydevd", "--port", "12345", "--"]
14+
args: ["python", "-m", "flask", "run", "--host=0.0.0.0"]
15+
ports:
16+
- containerPort: 5000
17+
- containerPort: 12345
18+
name: pydevd
19+
env:
20+
- name: WRAPPER_VERBOSE
21+
value: debug
22+
readinessProbe:
23+
httpGet:
24+
path: /
25+
port: 5000
26+
volumeMounts:
27+
- mountPath: /dbg
28+
name: python-debugging-support
29+
initContainers:
30+
- image: skaffold-debug-python
31+
name: install-python-support
32+
resources: {}
33+
volumeMounts:
34+
- mountPath: /dbg
35+
name: python-debugging-support
36+
volumes:
37+
- emptyDir: {}
38+
name: python-debugging-support
39+
40+
---
41+
apiVersion: v1
42+
kind: Service
43+
metadata:
44+
name: hello-pydevd-python3-11
45+
spec:
46+
ports:
47+
- name: http
48+
port: 5000
49+
protocol: TCP
50+
- name: pydevd
51+
port: 12345
52+
protocol: TCP
53+
selector:
54+
app: hello
55+
protocol: pydevd
56+
runtime: python3_11
57+
58+
---
59+
apiVersion: batch/v1
60+
kind: Job
61+
metadata:
62+
name: connect-to-python3-11
63+
labels:
64+
project: container-debug-support
65+
type: integration-test
66+
spec:
67+
ttlSecondsAfterFinished: 10
68+
backoffLimit: 1
69+
template:
70+
spec:
71+
restartPolicy: Never
72+
containers:
73+
- name: verify-python3-11
74+
image: pydevconnect
75+
args: ["hello-pydevd-python3-11:12345"]
76+
77+

0 commit comments

Comments
 (0)