Skip to content

Commit 6cbdf87

Browse files
authored
update testing for python 3.14 (#1955)
* update testing for python 3.14 * Allow python 3.14 in attach code * move 3.14 to its own job outside of matrix * try 3.14.0-rc.2 * allowUnstable * use 3.14.0-rc.2 but use 3.14 in tests
1 parent 2eb3afe commit 6cbdf87

File tree

7 files changed

+36
-17
lines changed

7 files changed

+36
-17
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ In order to update the source, you would:
114114

115115
You might need to regenerate the Cython modules after any changes. This can be done by:
116116

117-
- Install Python latest (3.12 as of this writing)
117+
- Install Python latest (3.14 as of this writing)
118118
- pip install cython 'django>=1.9' 'setuptools>=0.9' 'wheel>0.21' twine
119119
- On a windows machine:
120120
- set FORCE_PYDEVD_VC_VARS=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat

azure-pipelines/pipelines.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ stages:
135135
python.version: 3.12
136136
py313:
137137
python.version: 3.13
138+
py314:
139+
python.version: 3.14.0-rc.2
138140

139141
steps:
140142

@@ -178,6 +180,8 @@ stages:
178180
python.version: 3.12
179181
py313:
180182
python.version: 3.13
183+
py314:
184+
python.version: 3.14.0-rc.2
181185

182186
steps:
183187

@@ -224,6 +228,8 @@ stages:
224228
python.version: 3.12
225229
py313:
226230
python.version: 3.13
231+
py314:
232+
python.version: 3.14.0-rc.2
227233

228234
steps:
229235

azure-pipelines/templates/run_tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ steps:
33
displayName: Setup Python packages
44

55
- pwsh: |
6-
$toxEnv = '$(python.version)'
7-
if (-not $toxEnv.startsWith('pypy')) {
8-
$toxEnv = 'py' + $toxEnv.Replace('.', '')
6+
$raw = '$(python.version)'
7+
if ($raw.StartsWith('pypy')) {
8+
# For PyPy keep original pattern stripping dots after first two numeric components if needed later.
9+
$toxEnv = 'py' + ($raw -replace '^pypy(\d+)\.(\d+).*$','$1$2')
910
}
10-
echo 'tox environment: $toxEnv'
11+
else {
12+
# Extract major.minor even from prerelease like 3.14.0-rc.2 -> 3.14
13+
$mm = [regex]::Match($raw,'^(\d+)\.(\d+)')
14+
if (-not $mm.Success) { throw "Unable to parse python.version '$raw'" }
15+
$toxEnv = 'py' + $mm.Groups[1].Value + $mm.Groups[2].Value
16+
}
17+
Write-Host "python.version raw: $raw"
18+
Write-Host "Derived tox environment: $toxEnv"
1119
python -m tox -e $toxEnv -- --junitxml=$(Build.ArtifactStagingDirectory)/tests.xml --debugpy-log-dir=$(Build.ArtifactStagingDirectory)/logs tests
1220
displayName: Run tests using tox
1321
env:

azure-pipelines/templates/use_python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ steps:
33
inputs:
44
versionSpec: $(python.version)
55
architecture: $(architecture)
6+
allowUnstable: true
67
displayName: Use Python $(python.version) $(architecture)

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,12 @@ def finalize_options(self):
7878
"Compiling pydevd Cython extension modules (set SKIP_CYTHON_BUILD=1 to omit)."
7979
)
8080
try:
81-
subprocess.check_call(
82-
[
83-
sys.executable,
84-
os.path.join(PYDEVD_ROOT, "setup_pydevd_cython.py"),
85-
"build_ext",
86-
"--inplace",
87-
]
88-
)
81+
subprocess.check_call([
82+
sys.executable,
83+
os.path.join(PYDEVD_ROOT, "setup_pydevd_cython.py"),
84+
"build_ext",
85+
"--inplace",
86+
])
8987
except subprocess.SubprocessError:
9088
# pydevd Cython extensions are optional performance enhancements, and debugpy is
9189
# usable without them. Thus, we want to ignore build errors here by default, so
@@ -170,6 +168,8 @@ def tail_is(*suffixes):
170168
"Programming Language :: Python :: 3.10",
171169
"Programming Language :: Python :: 3.11",
172170
"Programming Language :: Python :: 3.12",
171+
"Programming Language :: Python :: 3.13",
172+
"Programming Language :: Python :: 3.14",
173173
"Topic :: Software Development :: Debuggers",
174174
"Operating System :: Microsoft :: Windows",
175175
"Operating System :: MacOS",
@@ -202,5 +202,5 @@ def tail_is(*suffixes):
202202
"debugpy-adapter = debugpy.adapter.__main__:main",
203203
],
204204
},
205-
**extras
205+
**extras,
206206
)

src/debugpy/_vendored/pydevd/pydevd_attach_to_process/common/py_version.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ enum PythonVersion {
2424
PythonVersion_311 = 0x030B,
2525
PythonVersion_312 = 0x030C,
2626
PythonVersion_313 = 0x030D,
27+
PythonVersion_314 = 0x030E,
2728
};
2829

2930

@@ -78,6 +79,9 @@ static PythonVersion GetPythonVersion(void *module) {
7879
if(version[3] == '3'){
7980
return PythonVersion_313;
8081
}
82+
if(version[3] == '4'){
83+
return PythonVersion_314;
84+
}
8185
}
8286
return PythonVersion_Unknown; // we don't care about 3.1 anymore...
8387

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{38,39,310,311,312,313}{,-cov}
2+
envlist = py{38,39,310,311,312,313,314}{,-cov}
33

44
[testenv]
55
deps = -rtests/requirements.txt
@@ -10,5 +10,5 @@ commands_pre = python build_attach_binaries.py
1010
commands =
1111
py{38,39}-!cov: python -m pytest {posargs}
1212
py{38,39}-cov: python -m pytest --cov --cov-append --cov-config=.coveragerc {posargs}
13-
py{310,311,312,313}-!cov: python -Xfrozen_modules=off -m pytest {posargs}
14-
py{310,311,312,313}-cov: python -Xfrozen_modules=off -m pytest --cov --cov-append --cov-config=.coveragerc {posargs}
13+
py{310,311,312,313,314}-!cov: python -Xfrozen_modules=off -m pytest {posargs}
14+
py{310,311,312,313,314}-cov: python -Xfrozen_modules=off -m pytest --cov --cov-append --cov-config=.coveragerc {posargs}

0 commit comments

Comments
 (0)