8000 Merge pull request #821 from murrayrm/test_matrix-22Dec2022 · python-control/python-control@f15fc0f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit f15fc0f

Browse files
authored
Merge pull request #821 from murrayrm/test_matrix-22Dec2022
Add test matrix against operating environments
2 parents 56f227f + 4d6a6bf commit f15fc0f

File tree

6 files changed

+411
-2
lines changed

6 files changed

+411
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name: build-env
2+
dependencies:
3+
- boa
4+
- numpy !=1.23.0

.github/conda-env/test-env.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: test-env
22
dependencies:
3+
- conda-build # for conda index
34
- pip
45
- coverage
56
- coveralls
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
""" set-conda-test-matrix.py
2+
3+
Create test matrix for conda packages
4+
"""
5+
import json, re
6+
from pathlib import Path
7+
8+
osmap = {'linux': 'ubuntu',
9+
'osx': 'macos',
10+
'win': 'windows',
11+
}
12+
13+
blas_implementations = ['unset', 'Generic', 'OpenBLAS', 'Intel10_64lp']
14+
15+
combinations = {'ubuntu': blas_implementations,
16+
'macos': blas_implementations,
17+
'windows': ['unset', 'Intel10_64lp'],
18+
}
19+
20+
conda_jobs = []
21+
for conda_pkg_file in Path("slycot-conda-pkgs").glob("*/*.tar.bz2"):
22+
cos = osmap[conda_pkg_file.parent.name.split("-")[0]]
23+
m = re.search(r'py(\d)(\d+)_', conda_pkg_file.name)
24+
pymajor, pyminor = int(m[1]), int(m[2])
25+
cpy = f'{pymajor}.{pyminor}'
26+
for cbl in combinations[cos]:
27+
cjob = {'packagekey': f'{cos}-{cpy}',
28+
'os': cos,
29+
'python': cpy,
30+
'blas_lib': cbl}
31+
conda_jobs.append(cjob)
32+
33+
matrix = { 'include': conda_jobs }
34+
print(json.dumps(matrix))
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
""" set-pip-test-matrix.py
2+
3+
Create test matrix for pip wheels
4+
"""
5+
import json
6+
from pathlib import Path
7+
8+
system_opt_blas_libs = {'ubuntu': ['OpenBLAS'],
9+
'macos' : ['OpenBLAS', 'Apple']}
10+
11+
wheel_jobs = []
12+
for wkey in Path("slycot-wheels").iterdir():
13+
wos, wpy, wbl = wkey.name.split("-")
14+
wheel_jobs.append({'packagekey': wkey.name,
15+
'os': wos,
16+
'python': wpy,
17+
'blas_lib': wbl,
18+
})
19+
if wbl == "Generic":
20+
for bl in system_opt_blas_libs[wos]:
21+
wheel_jobs.append({ 'packagekey': wkey.name,
22+
'os': wos,
23+
'python': wpy,
24+
'blas_lib': bl,
25+
})
26+
27+
matrix = { 'include': wheel_jobs }
28+
print(json.dumps(matrix))

0 commit comments

Comments
 (0)
0