Repository navigation
125 lines (108 loc) · 3.39 KB
/
Copy pathpython-package.yml
File metadata and controls
125 lines (108 loc) · 3.39 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Python package
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: python-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.14"]
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --editable .
python -m pip install coverage flake8 pytest
- name: Check for Python errors
run: flake8 apbs --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run tests with coverage
run: |
python -m coverage run --source=apbs -m pytest test
python -m coverage report --show-missing | tee coverage.txt
python -m coverage xml
- name: Store coverage results
uses: actions/upload-artifact@v7
with:
name: python-${{ matrix.python-version }}-coverage
path: |
coverage.txt
coverage.xml
bindings:
name: Python bindings
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up Python 3.14
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
bison \
build-essential \
flex \
libboost-dev \
libeigen3-dev \
liblapack-dev \
libopenblas-serial-dev \
libreadline-dev \
libsuitesparse-dev \
swig
git clone --depth 1 https://github.com/Electrostatics/metis-fork.git /tmp/metis
cd /tmp/metis
make config prefix=/usr/local
sudo make install
- name: Configure Python bindings
run: |
cmake -S . -B build-bindings \
-DAPBS_STATIC_BUILD=OFF \
-DBLA_VENDOR=OpenBLAS \
-DBUILD_DOC=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TOOLS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$PWD/build-bindings/install" \
-DENABLE_BEM=OFF \
-DENABLE_GEOFLOW=OFF \
-DENABLE_iAPBS=OFF \
-DENABLE_PBAM=OFF \
-DENABLE_PBSAM=OFF \
-DENABLE_PYGBE=OFF \
-DENABLE_PYTHON=ON \
-DENABLE_TESTS=OFF \
-DGET_NanoShaper=OFF \
-DPYTHON_VERSION=3.14
- name: Build and install Python bindings
run: cmake --build build-bindings --parallel 2 --target install
- name: Test Python bindings
run: |
cd /tmp
PYTHONPATH="$GITHUB_WORKSPACE/build-bindings/install/lib" \
python "$GITHUB_WORKSPACE/tools/python/test_bindings.py"