Skip to content

Commit 562ff8e

Browse files
Fix typos (#832)
Use Conda Python headers
1 parent 1fdde70 commit 562ff8e

1 file changed

Lines changed: 62 additions & 8 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,35 @@ jobs:
4747
conda config --show-sources
4848
conda list --show-channel-urls
4949
50+
- name: Meson args - use active Python include/lib (Ubuntu)
51+
if: startsWith(matrix.platform, 'ubuntu')
52+
run: |
53+
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
54+
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
55+
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
56+
5057
- name: Install numcodecs
5158
run: |
52-
# TODO: Remove this conditional when pcodec supports Python 3.14
53-
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
54-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
59+
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
60+
# TODO: Remove this conditional when pcodec supports Python 3.14
61+
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
62+
python -m pip install -v \
63+
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
64+
".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
65+
else
66+
python -m pip install -v \
67+
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
68+
".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
69+
fi
5570
else
56-
python -m pip install -v ".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
71+
# TODO: Remove this conditional when pcodec supports Python 3.14
72+
if [[ "${{ matrix.python-version }}" == "3.14" ]]; then
73+
python -m pip install -v \
74+
".[test,test_extras,msgpack,google_crc32c,crc32c,zfpy]"
75+
else
76+
python -m pip install -v \
77+
".[test,test_extras,msgpack,google_crc32c,crc32c,pcodec,zfpy]"
78+
fi
5779
fi
5880
5981
- name: List installed packages
@@ -103,12 +125,31 @@ jobs:
103125
- name: Install compilers
104126
run: conda install -y c-compiler cxx-compiler
105127

128+
- name: Meson args - use active Python include/lib (Ubuntu)
129+
if: startsWith(matrix.platform, 'ubuntu')
130+
run: |
131+
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
132+
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
133+
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
134+
106135
- name: Install numcodecs
107136
run: |
108-
if [[ -n "${{ matrix.extras }}" ]]; then
109-
python -m pip install -v ".[${{ matrix.extras }},test]"
137+
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
138+
if [[ -n "${{ matrix.extras }}" ]]; then
139+
python -m pip install -v \
140+
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
141+
".[${{ matrix.extras }},test]"
142+
else
143+
python -m pip install -v \
144+
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
145+
".[test]"
146+
fi
110147
else
111-
python -m pip install -v ".[test]"
148+
if [[ -n "${{ matrix.extras }}" ]]; then
149+
python -m pip install -v ".[${{ matrix.extras }},test]"
150+
else
151+
python -m pip install -v ".[test]"
152+
fi
112153
fi
113154
114155
- name: List installed packages
@@ -157,9 +198,22 @@ jobs:
157198
- name: Install compilers
158199
run: conda install -y c-compiler cxx-compiler
159200

201+
- name: Meson args - use active Python include/lib (Ubuntu)
202+
if: startsWith(matrix.platform, 'ubuntu')
203+
run: |
204+
PY_INC=$(python -c "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))")
205+
echo "PY_INC=$PY_INC" >> $GITHUB_ENV
206+
echo "MESON_SETUP_ARGS=-Dc_args=-I${PY_INC} -Dc_link_args=-L${CONDA_PREFIX}/lib" >> $GITHUB_ENV
207+
160208
- name: Install numcodecs and Zarr
161209
run: |
162-
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
210+
if [[ "${{ startsWith(matrix.platform, 'ubuntu') }}" == "true" ]]; then
211+
python -m pip install -v \
212+
--config-settings="setup-args=${MESON_SETUP_ARGS}" \
213+
".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
214+
else
215+
python -m pip install -v ".[test,test_extras]" "${{ matrix.zarr-pkg }}" crc32c
216+
fi
163217
- name: List installed packages
164218
run: python -m pip list
165219

0 commit comments

Comments
 (0)