Skip to content

Commit f780ce2

Browse files
authored
Merge pull request #250 from roryyorke/rory/conda-ci
Fix conda builds in Github continuous integration workflows.
2 parents 05016a8 + 0498d52 commit f780ce2

File tree

7 files changed

+64
-61
lines changed

7 files changed

+64
-61
lines changed

.github/conda-env/build-env.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/scripts/run-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ donttest="test_root_locus_zoom or test_sisotool"
1616
# don't care about deprecation warnings here
1717
donttest="$donttest or test_default_deprecation"
1818
pytest control/tests \
19+
-m slycot \
1920
--cov=$slycot_libdir \
2021
--cov-config=${slycot_srcdir}/.coveragerc \
2122
--ignore=control/tests/docstrings_test.py \

.github/scripts/set-conda-test-matrix.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
conda_jobs = []
19-
for conda_pkg_file in Path("slycot-conda-pkgs").glob("*/*.tar.bz2"):
19+
for conda_pkg_file in Path("slycot-conda-pkgs").glob("*/*.conda"):
2020
cos = osmap[conda_pkg_file.parent.name.split("-")[0]]
2121
m = re.search(r'py(\d)(\d+)_', conda_pkg_file.name)
2222
pymajor, pyminor = int(m[1]), int(m[2])
@@ -28,5 +28,8 @@
2828
'blas_lib': cbl}
2929
conda_jobs.append(cjob)
3030

31+
if not conda_jobs:
32+
raise SystemExit("No conda packages found")
33+
3134
matrix = { 'include': conda_jobs }
3235
print(json.dumps(matrix))

.github/workflows/slycot-build-and-test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
retention-days: 5
152152

153153
build-conda:
154-
name: Build conda, ${{ matrix.os }}
154+
name: Build conda, ${{ matrix.os }} ${{ matrix.python }}
155155
runs-on: ${{ matrix.os }}-latest
156156
needs: build-sdist
157157
strategy:
@@ -162,8 +162,7 @@ jobs:
162162
- 'macos'
163163
- 'windows'
164164
python:
165-
# this is not the packaged version, just the version conda-build runs on.
166-
- '3.11'
165+
- '3.13'
167166

168167
steps:
169168
- name: Checkout Slycot
@@ -174,33 +173,33 @@ jobs:
174173
- name: Setup Conda
175174
uses: conda-incubator/setup-miniconda@v3
176175
with:
176+
auto-update-conda: true
177177
python-version: ${{ matrix.python }}
178178
activate-environment: build-env
179-
environment-file: .github/conda-env/build-env.yml
180179
miniforge-version: latest
180+
conda-build-version: 25.7.0
181181
channel-priority: strict
182-
channels: conda-forge,defaults
183-
auto-update-conda: false
184-
auto-activate-base: false
185182
- name: Conda build
186183
shell: bash -el {0}
187184
run: |
188185
set -e
189-
conda build conda-recipe
186+
conda build conda-recipe --python ${{ matrix.python }}
190187
# preserve directory structure for custom conda channel
191-
find "${CONDA_PREFIX}/conda-bld" -maxdepth 2 -name 'slycot*.tar.bz2' | while read -r conda_pkg; do
188+
CONDA_ROOT=$(conda info --base)
189+
find "${CONDA_ROOT}/conda-bld" -maxdepth 2 -name 'slycot*.conda' | while read -r conda_pkg; do
192190
conda_platform=$(basename $(dirname "${conda_pkg}"))
193191
mkdir -p "slycot-conda-pkgs/${conda_platform}"
194192
cp "${conda_pkg}" "slycot-conda-pkgs/${conda_platform}/"
195193
done
196-
python -m conda_index ./slycot-conda-pkgs
194+
conda index ./slycot-conda-pkgs
197195
- name: Save to local conda pkg channel
198196
uses: actions/upload-artifact@v4
199197
with:
200198
name: slycot-conda-pkgs-${{ matrix.os }}-${{ matrix.python }}
201199
path: slycot-conda-pkgs
202200
retention-days: 5
203201

202+
204203
create-wheel-test-matrix:
205204
name: Create wheel test matrix
206205
runs-on: ubuntu-latest
@@ -404,6 +403,7 @@ jobs:
404403
parallel: true
405404
file: slycot-src/coverage.xml
406405

406+
407407
coveralls-final:
408408
name: Finalize parallel coveralls
409409
if: always()

conda-recipe/bld.bat

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
:: correct FC, apparently pointed to host prefix??
2-
set FC=%BUILD_PREFIX%\Library\bin\flang.exe
31
set BLAS_ROOT=%PREFIX%
42
set LAPACK_ROOT=%PREFIX%
53

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
1-
# https://github.com/conda-forge/blas-feedstock/issues/106#issuecomment-1771747983
2-
# https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/conda_build_config.yaml
3-
# https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/main/recipe/migrations/python312.yaml
4-
5-
# zip_keys Python/Numpy matrix to build for
6-
python:
7-
- 3.10.* *_cpython
8-
- 3.12.* *_cpython
9-
numpy:
10-
- 1.23
11-
- 1.26
12-
13-
zip_keys:
14-
-
15-
- python
16-
- numpy
17-
18-
# Compiler selection
1+
MACOSX_DEPLOYMENT_TARGET:
2+
- '11.0' # [osx]
3+
MACOSX_SDK_VERSION:
4+
- '11.0' # [osx]
195
c_compiler:
20-
- gcc # [linux]
21-
- clang # [osx]
22-
- vs2019 # [win and x86_64]
23-
- vs2022 # [win and arm64]
24-
c_compiler_version: # [unix]
25-
- 12 # [linux]
26-
- 16 # [osx]
27-
fortran_compiler: # [unix or win64]
28-
- gfortran # [linux64 or (osx and x86_64)]
29-
- gfortran # [aarch64 or ppc64le or armv7l or s390x]
30-
- flang # [win64]
31-
fortran_compiler_version: # [unix or win64]
32-
- 12 # [linux]
33-
- 12 # [osx]
34-
- 5 # [win64]
35-
36-
# Pinning
37-
38-
# blas
6+
- vs2022 # [win64]
7+
- gcc # [linux]
8+
- clang # [osx]
9+
c_compiler_version:
10+
- '14' # [linux]
11+
- '19' # [osx]
12+
c_stdlib:
13+
- vs # [win64]
14+
- sysroot #[linux]
15+
- macosx_deployment_target # [osx]
16+
c_stdlib_version:
17+
- '2.17' # [linux]
18+
- '11.0' # [osx]
19+
cdt_name:
20+
- conda # [linux]
21+
channel_sources:
22+
- conda-forge
23+
channel_targets:
24+
- conda-forge main
25+
fortran_compiler:
26+
- flang # [win64]
27+
- gfortran # [linux or osx]
28+
fortran_compiler_version:
29+
- '5' # [win64]
30+
- '14' # [linux or osx]
3931
libblas:
40-
- 3.9 *netlib
32+
- 3.9 *netlib
4133
libcblas:
42-
- 3.9 *netlib
34+
- 3.9 *netlib
4335
liblapack:
44-
- 3.9 *netlib
45-
liblapacke:
46-
- 3.9 *netlib
36+
- 3.9 *netlib
37+
numpy:
38+
- '2'
39+
pin_run_as_build:
40+
python:
41+
min_pin: x.x
42+
max_pin: x.x
43+
python:
44+
- 3.10.* *_cpython
45+
- 3.11.* *_cpython
46+
- 3.12.* *_cpython
47+
- 3.13.* *_cp313

conda-recipe/meta.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ build:
1111

1212
requirements:
1313
build:
14+
- python # [build_platform != target_platform]
15+
- cross-python_{{ target_platform }} # [build_platform != target_platform]
16+
- numpy # [build_platform != target_platform]
17+
- scikit-build >=0.15 # [build_platform != target_platform]
1418
- {{ compiler('fortran') }}
1519
- {{ compiler('c') }}
20+
- {{ stdlib("c") }}
1621
- cmake >=3.14
1722
- make # [linux]
1823
host:
@@ -26,8 +31,7 @@ requirements:
2631
- setuptools >=45
2732
- setuptools_scm >=7
2833
run:
29-
- python {{ PY_VER }}
30-
- {{ pin_compatible('numpy') }}
34+
- python
3135

3236
test:
3337
requires:

0 commit comments

Comments
 (0)