Skip to content

Commit 3597e84

Browse files
authored
Merge pull request #127 from BoPeng/collection
Modernize Build System: Migrate from setup.py to CMake + scikit-build-core (#126)
2 parents 7871c48 + 2443990 commit 3597e84

2,387 files changed

Lines changed: 512898 additions & 1255 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-app.yml

Lines changed: 176 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This workflow will install Python dependencies and run tests
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
1+
# This workflow will install Python dependencies, build simuPOP, and run tests
2+
# across multiple platforms (Linux, macOS, Windows) and Python versions.
33

4-
name: SimuPOP
4+
name: simuPOP CI
55

66
on:
77
push:
@@ -13,30 +13,192 @@ permissions:
1313
contents: read
1414

1515
jobs:
16-
build:
16+
build-linux:
1717
runs-on: ubuntu-latest
18-
timeout-minutes: 60
18+
timeout-minutes: 90
1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
python-version: ["3.9", "3.10", "3.11", "3.12"]
2323

2424
steps:
2525
- uses: actions/checkout@v4
26+
2627
- name: Set up Python ${{ matrix.python-version }}
27-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
2829
with:
2930
python-version: ${{ matrix.python-version }}
3031
cache: 'pip'
31-
# - name: Install boost
32-
# run: |
33-
# sudo apt-get install libboost1.74-all-dev
34-
# ln -s /usr/include/boost/ ./boost_1_74_0
35-
- name: Install dependencies
32+
33+
- name: Install system dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y swig zlib1g-dev cmake ninja-build
37+
38+
- name: Install Python dependencies
3639
run: |
3740
python -m pip install --upgrade pip
41+
pip install build scikit-build-core cmake ninja
3842
pip install -r requirements.txt
39-
- name: Install simuPOP
40-
run: python setup.py install
41-
- name: Run tests
43+
44+
- name: Build and install simuPOP
45+
run: pip install -v .
46+
47+
- name: Run tests (short allele type)
48+
run: python ./test/run_tests.py short -j2
49+
50+
- name: Run tests (binary allele type)
51+
run: python ./test/run_tests.py binary -j2
52+
53+
build-macos-intel:
54+
runs-on: macos-13
55+
timeout-minutes: 90
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
python-version: ["3.10", "3.11", "3.12"]
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Python ${{ matrix.python-version }}
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: ${{ matrix.python-version }}
68+
cache: 'pip'
69+
70+
- name: Install system dependencies
71+
run: |
72+
brew install swig libomp cmake ninja
73+
74+
- name: Install Python dependencies
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install build scikit-build-core cmake ninja
78+
pip install -r requirements.txt
79+
80+
- name: Build and install simuPOP
81+
env:
82+
OpenMP_ROOT: /usr/local/opt/libomp
83+
run: pip install -v .
84+
85+
- name: Run tests (short allele type)
86+
run: python ./test/run_tests.py short -j2
87+
88+
- name: Run tests (binary allele type)
89+
run: python ./test/run_tests.py binary -j2
90+
91+
build-macos-arm:
92+
runs-on: macos-14
93+
timeout-minutes: 90
94+
strategy:
95+
fail-fast: false
96+
matrix:
97+
python-version: ["3.10", "3.11", "3.12"]
98+
99+
steps:
100+
- uses: actions/checkout@v4
101+
102+
- name: Set up Python ${{ matrix.python-version }}
103+
uses: actions/setup-python@v5
104+
with:
105+
python-version: ${{ matrix.python-version }}
106+
cache: 'pip'
107+
108+
- name: Install system dependencies
109+
run: |
110+
brew install swig libomp cmake ninja
111+
112+
- name: Install Python dependencies
113+
run: |
114+
python -m pip install --upgrade pip
115+
pip install build scikit-build-core cmake ninja
116+
pip install -r requirements.txt
117+
118+
- name: Build and install simuPOP
119+
env:
120+
OpenMP_ROOT: /opt/homebrew/opt/libomp
121+
run: pip install -v .
122+
123+
- name: Run tests (short allele type)
124+
run: python ./test/run_tests.py short -j2
125+
126+
- name: Run tests (binary allele type)
127+
run: python ./test/run_tests.py binary -j2
128+
129+
build-windows:
130+
runs-on: windows-latest
131+
timeout-minutes: 120
132+
strategy:
133+
fail-fast: false
134+
matrix:
135+
python-version: ["3.10", "3.11", "3.12"]
136+
137+
steps:
138+
- uses: actions/checkout@v4
139+
140+
- name: Set up Python ${{ matrix.python-version }}
141+
uses: actions/setup-python@v5
142+
with:
143+
python-version: ${{ matrix.python-version }}
144+
cache: 'pip'
145+
146+
- name: Install SWIG
147+
run: choco install swig -y
148+
149+
- name: Install zlib via vcpkg (static)
150+
run: |
151+
vcpkg install zlib:x64-windows-static
152+
153+
- name: Install Python dependencies
154+
run: |
155+
python -m pip install --upgrade pip
156+
pip install build scikit-build-core cmake ninja
157+
pip install -r requirements.txt
158+
159+
- name: Build and install simuPOP
160+
run: |
161+
$toolchain = "$env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake"
162+
pip install -v . --config-settings=cmake.args="-DCMAKE_TOOLCHAIN_FILE=$toolchain;-DVCPKG_TARGET_TRIPLET=x64-windows-static"
163+
164+
- name: Run tests (short allele type)
165+
run: python ./test/run_tests.py short -j2
166+
167+
- name: Run tests (binary allele type)
168+
run: python ./test/run_tests.py binary -j2
169+
170+
# Full test suite on Linux (all allele types)
171+
full-tests-linux:
172+
runs-on: ubuntu-latest
173+
timeout-minutes: 180
174+
needs: build-linux
175+
strategy:
176+
fail-fast: false
177+
matrix:
178+
python-version: ["3.11"]
179+
180+
steps:
181+
- uses: actions/checkout@v4
182+
183+
- name: Set up Python ${{ matrix.python-version }}
184+
uses: actions/setup-python@v5
185+
with:
186+
python-version: ${{ matrix.python-version }}
187+
cache: 'pip'
188+
189+
- name: Install system dependencies
190+
run: |
191+
sudo apt-get update
192+
sudo apt-get install -y swig zlib1g-dev cmake ninja-build
193+
194+
- name: Install Python dependencies
195+
run: |
196+
python -m pip install --upgrade pip
197+
pip install build scikit-build-core cmake ninja
198+
pip install -r requirements.txt
199+
200+
- name: Build and install simuPOP
201+
run: pip install -v .
202+
203+
- name: Run all tests
42204
run: python ./test/run_tests.py

0 commit comments

Comments
 (0)