Skip to content

Commit d50034a

Browse files
More fixing
1 parent d1f2691 commit d50034a

File tree

1 file changed

+27
-38
lines changed

1 file changed

+27
-38
lines changed

.github/workflows/ci.yaml

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,26 @@ jobs:
4949
conda config --show-sources
5050
conda list --show-channel-urls
5151
52-
- name: Meson args - use active Python include/lib (Ubuntu)
52+
- name: Meson args - prefer Conda over system Python (Ubuntu)
5353
if: startsWith(matrix.platform, 'ubuntu')
5454
run: |
55-
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
56-
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
57-
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
55+
cat > meson-prefer-conda-python.ini <<EOF
56+
[binaries]
57+
python = '${CONDA_PREFIX}/bin/python'
58+
EOF
5859
5960
- name: Install numcodecs
6061
run: |
6162
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
6263
# TODO: Remove this conditional when pcodec supports Python 3.14
6364
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
6465
python -m pip install -v \
65-
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
66+
--config-settings=setup-args=--native-file=meson-prefer-conda-python.ini \
6667
".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]" \
6768
pytest
6869
else
6970
python -m pip install -v \
70-
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
71+
--config-settings=setup-args=--native-file=meson-prefer-conda-python.ini \
7172
".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]" \
7273
pytest
7374
fi
@@ -132,31 +133,23 @@ jobs:
132133
- name: Install compilers
133134
run: conda install -y c-compiler cxx-compiler
134135

135-
- name: Meson args - use active Python include/lib (Ubuntu)
136-
if: startsWith(matrix.platform, 'ubuntu')
136+
- name: Meson args - prefer Conda over system Python (Ubuntu)
137137
run: |
138-
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
139-
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
140-
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
138+
cat > meson-prefer-conda-python.ini <<EOF
139+
[binaries]
140+
python = '${CONDA_PREFIX}/bin/python'
141+
EOF
141142
142143
- name: Install numcodecs
143144
run: |
144-
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
145-
if [[ -n "${{ matrix.extras }}" ]]; then
146-
python -m pip install -v \
147-
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
148-
".[${{ matrix.extras }},test]"
149-
else
150-
python -m pip install -v \
151-
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
152-
".[test]"
153-
fi
145+
if [[ -n "${{ matrix.extras }}" ]]; then
146+
python -m pip install -v \
147+
--config-settings=setup-args=--native-file=meson-prefer-conda-python.ini \
148+
".[${{ matrix.extras }},test]"
154149
else
155-
if [[ -n "${{ matrix.extras }}" ]]; then
156-
python -m pip install -v ".[${{ matrix.extras }},test]"
157-
else
158-
python -m pip install -v ".[test]"
159-
fi
150+
python -m pip install -v \
151+
--config-settings=setup-args=--native-file=meson-prefer-conda-python.ini \
152+
".[test]"
160153
fi
161154
162155
- name: List installed packages
@@ -207,22 +200,18 @@ jobs:
207200
- name: Install compilers
208201
run: conda install -y c-compiler cxx-compiler
209202

210-
- name: Meson args - use active Python include/lib (Ubuntu)
211-
if: startsWith(matrix.platform, 'ubuntu')
203+
- name: Meson args - prefer Conda over system Python (Ubuntu)
212204
run: |
213-
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
214-
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
215-
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
205+
cat > meson-prefer-conda-python.ini <<EOF
206+
[binaries]
207+
python = '${CONDA_PREFIX}/bin/python'
208+
EOF
216209
217210
- name: Install numcodecs and Zarr
218211
run: |
219-
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
220-
python -m pip install -v \
221-
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
222-
".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
223-
else
224-
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
225-
fi
212+
python -m pip install -v \
213+
--config-settings=setup-args=--native-file=meson-prefer-conda-python.ini \
214+
".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
226215
- name: List installed packages
227216
run: python -m pip list
228217

0 commit comments

Comments
 (0)