Skip to content

Commit 485d45d

Browse files
committed
build: ensure non-gil wheels are not made for free threaded
1 parent f183923 commit 485d45d

File tree

4 files changed

+114
-55
lines changed

4 files changed

+114
-55
lines changed

Jenkinsfile

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ def installMSVCRuntime(cacheLocation){
7171
powershell(label: 'Install VC Runtime', script: 'Start-Process -filepath "$Env:CACHED_FILE" -ArgumentList "/install", "/passive", "/norestart" -Passthru | Wait-Process;')
7272
}
7373
}
74-
def SUPPORTED_MAC_VERSIONS = ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
75-
def SUPPORTED_LINUX_VERSIONS = ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
76-
def SUPPORTED_WINDOWS_VERSIONS = ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
74+
def SUPPORTED_MAC_VERSIONS = ['3.10+gil', '3.11+gil', '3.12+gil', '3.13+gil', '3.14+gil', '3.14t']
75+
def SUPPORTED_LINUX_VERSIONS = ['3.10+gil', '3.11+gil', '3.12+gil', '3.13+gil', '3.14+gil', '3.14t']
76+
def SUPPORTED_WINDOWS_VERSIONS = ['3.10+gil', '3.11+gil', '3.12+gil', '3.13+gil', '3.14+gil', '3.14t']
7777
// ============================================================================
7878
// Dynamic variables. Used to help manage state
7979
def wheelStashes = []
@@ -178,7 +178,7 @@ def windows_wheels(pythonVersions, testPackages, params, wheelStashes){
178178
bat(label: 'Running Tox',
179179
script: """python -m venv venv
180180
venv\\Scripts\\pip install --disable-pip-version-check uv
181-
venv\\Scripts\\uv run --only-group tox --python ${pythonVersion} --with tox-uv tox run -e py${pythonVersion.replace('.', '')} --installpkg ${it.path}
181+
venv\\Scripts\\uv run --only-group tox --python ${pythonVersion} --with tox-uv tox run -e py${pythonVersion.replace('.', '').replace('+gil', '')} --installpkg ${it.path}
182182
rmdir /S /Q venv
183183
rmdir /S /Q .tox
184184
"""
@@ -254,22 +254,19 @@ def linux_wheels(pythonVersions, testPackages, params, wheelStashes){
254254
'UV_TOOL_DIR=/tmp/uvtools',
255255
'UV_PYTHON_INSTALL_DIR=/tmp/uvpython',
256256
'UV_CACHE_DIR=/tmp/uvcache',
257-
"TOX_INSTALL_PKG=${findFiles(glob:'dist/*.whl')[0].path}",
258-
"TOX_ENV=py${pythonVersion.replace('.', '')}",
259257
'UV_INDEX_STRATEGY=unsafe-best-match',
260258
"UV_CONFIG_FILE=${createUVConfig()}"
261259
]){
262260
docker.image('python').inside('--mount source=python-tmp-py3exiv2bind,target=/tmp'){
263261
timeout(60){
264262
sh(
265263
label: 'Testing with tox',
266-
script: '''python3 -m venv venv
267-
. ./venv/bin/activate
264+
script: """python3 -m venv venv
268265
trap "rm -rf venv" EXIT
269-
pip install --disable-pip-version-check uv
270-
uv run --only-group tox --with tox-uv tox
266+
./venv/bin/pip install --disable-pip-version-check uv
267+
./venv/bin/uv run --only-group=tox --with=tox-uv tox --installpkg ${findFiles(glob:'dist/*.whl')[0].path} -e py${pythonVersion.replace('.', '').replace('+gil','')}
271268
rm -rf .tox
272-
'''
269+
"""
273270
)
274271
}
275272
}
@@ -316,7 +313,7 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
316313
stage(newWheelStage){
317314
if(selectedArches.contains(arch)){
318315
stage("Build Wheel (${pythonVersion} MacOS ${arch})"){
319-
node("mac && python${pythonVersion} && ${arch}"){
316+
node("mac && python3 && ${arch}"){
320317
timeout(60){
321318
checkout scm
322319
try{
@@ -340,7 +337,7 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
340337
}
341338
if(testPackages == true){
342339
stage("Test Wheel (${pythonVersion} MacOS ${arch})"){
343-
node("mac && python${pythonVersion} && ${arch}"){
340+
node("mac && python3 && ${arch}"){
344341
checkout scm
345342
unstash "python${pythonVersion} mac ${arch} wheel"
346343
def wheels = findFiles(glob: 'dist/*.whl')
@@ -352,9 +349,9 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
352349
withEnv(["UV_CONFIG_FILE=${createUVConfig()}"]){
353350
timeout(60){
354351
sh(label: 'Running Tox',
355-
script: """python${pythonVersion} -m venv venv
352+
script: """python3 -m venv venv
356353
./venv/bin/python -m pip install --disable-pip-version-check uv
357-
./venv/bin/uv run --only-group tox --with tox-uv tox run --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}"""
354+
./venv/bin/uv run --only-group tox --with tox-uv tox run --installpkg ${it.path} -e py${pythonVersion.replace('.', '').replace('+gil', '')}"""
358355
)
359356
}
360357
}
@@ -378,7 +375,7 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
378375
stage("Universal2 Wheel: Python ${pythonVersion}"){
379376
stage('Make Universal2 wheel'){
380377
retry(3){
381-
node("mac && python${pythonVersion}") {
378+
node("mac && python3") {
382379
try{
383380
checkout scm
384381
withEnv(["UV_CONFIG_FILE=${createUVConfig()}"]){
@@ -389,7 +386,7 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
389386
wheelNames.add(wheelFile.path)
390387
}
391388
sh(label: 'Make Universal2 wheel',
392-
script: """python${pythonVersion} -m venv venv
389+
script: """python${pythonVersion.replace('+gil', '')} -m venv venv
393390
. ./venv/bin/activate
394391
pip install --disable-pip-version-check --upgrade pip
395392
pip install --disable-pip-version-check wheel delocate
@@ -400,7 +397,7 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
400397
)
401398
def fusedWheel = findFiles(excludes: '', glob: 'out/*.whl')[0]
402399
def props = readTOML( file: 'pyproject.toml')['project']
403-
def universalWheel = "py3exiv2bind-${props.version}-cp${pythonVersion.replace('.','')}-cp${pythonVersion.replace('.','')}-macosx_11_0_universal2.whl"
400+
def universalWheel = "py3exiv2bind-${props.version}-cp${pythonVersion.replace('.', '').replace('+git', '')}-cp${pythonVersion.replace('.','').replace('+gil', '')}-macosx_11_0_universal2.whl"
404401
sh "mv ${fusedWheel.path} ./dist/${universalWheel}"
405402
stash includes: 'dist/*.whl', name: "python${pythonVersion} mac-universal2 wheel"
406403
wheelStashes << "python${pythonVersion} mac-universal2 wheel"
@@ -422,18 +419,18 @@ def mac_wheels(pythonVersions, testPackages, params, wheelStashes){
422419
Utils.markStageSkippedForConditional("Test Python ${pythonVersion} universal2 Wheel on ${arch} mac")
423420
return
424421
}
425-
node("mac && python${pythonVersion} && ${arch}"){
422+
node("mac && python3 && ${arch}"){
426423
try{
427424
checkout scm
428425
withEnv(["UV_CONFIG_FILE=${createUVConfig()}"]){
429426
unstash "python${pythonVersion} mac-universal2 wheel"
430427
findFiles(glob: 'dist/*.whl').each{
431428
sh(label: 'Running Tox',
432-
script: """python${pythonVersion} -m venv venv
429+
script: """python3 -m venv venv
433430
trap "rm -rf venv" EXIT
434431
./venv/bin/python -m pip install --disable-pip-version-check uv
435432
trap "rm -rf venv && rm -rf .tox" EXIT
436-
./venv/bin/uv run --only-group tox --python=${pythonVersion} --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
433+
./venv/bin/uv run --only-group tox --python=${pythonVersion} --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '').replace('+gil', '')}
437434
"""
438435
)
439436
}
@@ -1190,7 +1187,7 @@ pipeline {
11901187
"${newStageName}": {
11911188
if(selectedArches.contains(arch)){
11921189
stage(newStageName){
1193-
node("mac && python${pythonVersion} && ${arch}"){
1190+
node("mac && python3 && ${arch}"){
11941191
checkout scm
11951192
unstash 'sdist'
11961193
findFiles(glob: 'dist/*.tar.gz').each{
@@ -1202,11 +1199,11 @@ pipeline {
12021199
]){
12031200
timeout(60){
12041201
sh(label: 'Running Tox',
1205-
script: """python${pythonVersion} -m venv venv
1202+
script: """python3 -m venv venv
12061203
trap "rm -rf venv" EXIT
12071204
./venv/bin/python -m pip install --disable-pip-version-check uv
12081205
trap "rm -rf venv && rm -rf .tox" EXIT
1209-
./venv/bin/uv run --only-group tox --python=${pythonVersion} --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
1206+
./venv/bin/uv run --only-group tox --python=${pythonVersion} --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '').replace('+gil', '')}
12101207
"""
12111208
)
12121209
}
@@ -1266,7 +1263,7 @@ pipeline {
12661263
timeout(60){
12671264
try{
12681265
bat(label: 'Running Tox',
1269-
script: """uv run --only-group tox --with tox-uv tox run --runner=uv-venv-runner --installpkg ${it.path} -e py${pythonVersion.replace('.', '')} -vv
1266+
script: """uv run --only-group tox --with tox-uv tox run --runner=uv-venv-runner --installpkg ${it.path} -e py${pythonVersion.replace('.', '').replace('+gil', '')} -vv
12701267
rmdir /S /Q .tox
12711268
"""
12721269
)
@@ -1341,7 +1338,7 @@ pipeline {
13411338
timeout(60){
13421339
sh(label: 'Running Tox',
13431340
script: """trap "rm -rf .tox" EXIT
1344-
uv run --only-group tox --python=${pythonVersion} --python-preference only-system --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '')}
1341+
uv run --only-group tox --python=${pythonVersion} --python-preference only-system --with tox-uv tox --installpkg ${it.path} -e py${pythonVersion.replace('.', '').replace('+gil', '')}
13451342
"""
13461343
)
13471344
}

scripts/build_linux_wheels.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ generate_wheel(){
4949

5050
case $platform in
5151
linux/amd64)
52-
manylinux_image=quay.io/pypa/manylinux_2_28_x86_64
52+
manylinux_image=quay.io/pypa/manylinux_2_28
5353
;;
5454
linux/arm64)
55-
manylinux_image=quay.io/pypa/manylinux_2_28_aarch64
55+
manylinux_image=quay.io/pypa/manylinux_2_28
5656
;;
5757
*)
5858
echo "Unsupported platform: $platform"

scripts/build_mac_wheel.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ generate_wheel(){
2525
uv_exec=$1
2626
project_root=$2
2727
python_version=$3
28-
if [[ $python_version != *t ]]; then
29-
python_version="${python_version}+gil"
30-
fi
3128

3229
# Get the processor type
3330
processor_type=$(uname -m)
@@ -65,10 +62,10 @@ generate_wheel(){
6562
echo ""
6663
echo "================================================================================"
6764
echo "${undelocate_wheel} is linked to the following:"
68-
$uv_path run --only-group package delocate-listdeps --depending "${undelocate_wheel}"
65+
$uv_path run --only-group=package --python=$python_version delocate-listdeps --depending "${undelocate_wheel}"
6966
echo ""
7067
echo "================================================================================"
71-
$uv_path run --only-group package delocate-wheel -w $output_path --require-archs $REQUIRED_ARCH --verbose "$undelocate_wheel"
68+
$uv_path run --only-group=package --python=$python_version delocate-wheel -w $output_path --require-archs $REQUIRED_ARCH --verbose "$undelocate_wheel"
7269
}
7370

7471

0 commit comments

Comments
 (0)