Skip to content

Commit 502c989

Browse files
committed
Add hack to get correct python version name
1 parent 1fc9ef0 commit 502c989

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/miniconda.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,23 @@ jobs:
2828
with:
2929
submodules: true
3030

31+
# Needed because github actions doesn't have a substring function
32+
# https://github.com/orgs/community/discussions/26625
33+
- name: Parse Python version
34+
id: parse-python-version
35+
run: |
36+
version=${${{ matrix.python-version }}%t}
37+
package_name=${{ endsWith(matrix.python-version, 't') && 'python-freethreading' || 'python' }}
38+
echo "::set-output name=version::$version"
39+
echo "::set-output name=package_name::$package_name"
40+
3141
- name: Setup Micromamba
3242
uses: mamba-org/setup-micromamba@v2
3343
with:
3444
environment-name: TEST
3545
init-shell: bash
3646
create-args: >-
37-
${{ endsWith(matrix.python-version, 't') && 'python-freethreading' || 'python' }}=${{ matrix.python-version }}
47+
${{ steps.parse-python-version.package_name }}=${{ steps.parse-python-version.version }}
3848
numpy cython pip setuptools pytest hdf5 libnetcdf cftime zlib certifi typing-extensions
3949
--channel conda-forge
4050

0 commit comments

Comments
 (0)