18
18
python-version :
19
19
required : true
20
20
type : string
21
+ free-threaded :
22
+ description : ' Whether FT Python or not. Valid value is "ft" or not.'
23
+ default : ' '
24
+ type : string
21
25
cuda-version :
22
26
required : true
23
27
type : string
30
34
type : string
31
35
32
36
env :
33
- ARTIFACT : wheel-linux-py${{ inputs.python-version }}-cuda${{ inputs.cuda-version }}${{ inputs.use-nvdec }}
37
+ ARTIFACT : wheel-linux-py${{ inputs.python-version }}${{ inputs.free-threaded }} -cuda${{ inputs.cuda-version }}${{ inputs.use-nvdec }}
34
38
SPDL_USE_TRACING : 1
35
39
SPDL_BUILD_STUB : 0
36
40
SPDL_USE_CUDA : 1
65
69
source $HOME/.local/bin/env
66
70
uv python list --only-installed
67
71
68
- py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
69
- python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
72
+ # note: 3.13t is in cp313-cp313t directory, others are in cp313-cp313 directory
73
+ v=${{ inputs.python-version }}
74
+ if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
75
+ dir="cp${v//[.t]/}-cp${v//[.]/}t"
76
+ # tmp: for some reason when ft is enabled, uv picks 3.12.
77
+ # so we delete others
78
+ for d in `find /opt/python/ -depth 1 -type d -not -name "${dir}"`; do
79
+ echo "Removing $d"
80
+ rm -rf "$d"
81
+ done
82
+ else
83
+ dir="cp${v//[.t]/}-cp${v//[.]/}"
84
+ fi
85
+ python_exe="/opt/python/${dir}/bin/python"
70
86
uv venv --python "${python_exe}"
71
87
uv build --all-packages --wheel
72
88
83
99
84
100
- name : Check package
85
101
run : |
86
- py_ver="$(echo '${{ inputs.python-version }}' | sed 's|[^0-9]*||g')"
87
- python_exe="/opt/python/cp${py_ver}-cp${py_ver}/bin/python"
88
-
102
+ # CFFI is not available yet for 3.13t, which prevents the installation of twine
103
+ # https://github.com/python-cffi/cffi/releases/tag/v1.17.0
104
+ # So we use the regular 3.13
105
+ v=${{ inputs.python-version }}
106
+ dir="cp${v//[.t]/}-cp${v//[.t]/}"
107
+ python_exe="/opt/python/${dir}/bin/python"
89
108
"${python_exe}" -m pip install -r ./packaging/requirements.txt
90
109
"${python_exe}" -m twine check --strict ~/package/*.whl
91
110
@@ -112,14 +131,25 @@ jobs:
112
131
path : ~/package
113
132
114
133
- uses : conda-incubator/setup-miniconda@v3
134
+ if : ${{ inputs.python-version != '3.13t' }}
135
+ with :
136
+ python-version : ${{ inputs.python-version }}
137
+ conda-remove-defaults : " true"
138
+
139
+ - uses : conda-incubator/setup-miniconda@v3
140
+ if : ${{ inputs.python-version == '3.13t' }}
115
141
with :
116
- python-version : " ${{ inputs.python-version }} "
142
+ python-version : ' 3.13 '
117
143
conda-remove-defaults : " true"
118
144
119
145
- name : Unit test
120
146
run : |
121
147
set -ex
122
148
149
+ if [[ "${{ inputs.free-threaded }}" == 'ft' ]]; then
150
+ conda install -q -c conda-forge python-freethreading
151
+ fi
152
+
123
153
# Install SPDL
124
154
pip install $(find "${HOME}/package" -name '*.whl' -depth -maxdepth 1)
125
155
0 commit comments