-
Notifications
You must be signed in to change notification settings - Fork 27
78 lines (66 loc) · 1.82 KB
/
Copy pathpython-library.yml
File metadata and controls
78 lines (66 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Python Library
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-library-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-wheel:
name: Build Python wheel
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Install build dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y \
cmake \
ninja-build \
libsuitesparse-dev \
libboost-dev \
gcc-15 \
g++-15
python -m pip install --upgrade pip
python -m pip install build pytest
- name: Build wheel
shell: bash
env:
CMAKE_ARGS: >-
-DCMAKE_C_COMPILER=gcc-15
-DCMAKE_CXX_COMPILER=g++-15
-DCMAKE_BUILD_TYPE=Release
-DGRIDDYN_ENABLE_OPENMP=OFF
run: python -m build --wheel
- name: Install built wheel
shell: bash
run: python -m pip install dist/*.whl
- name: Check extension dependencies
shell: bash
run: |
python - <<'PY'
import subprocess
import griddyn._core as core
extension = core.__file__
dependencies = subprocess.check_output(["ldd", extension], text=True)
print(dependencies)
if "minizip" in dependencies.lower():
raise SystemExit("Python extension must not depend on shared minizip")
PY
- name: Run Python tests
shell: bash
run: python -m pytest python/tests