Skip to content

Commit 3e7c427

Browse files
authored
ENH: Rehaul meson build script (#133)
* MAINT: Bump to 3.9 3.8 is EOL for the past 8 months now.. and not built on CI anyway xref: #117 * ENH: Rework meson build Be more DRY * ENH: Add use_openmp for meson * ENH: Setup installation directory Stop polluting site-packages with _scs*.so * MAINT: Move to enable python -mpytest test in the same directory, otherwise scs/__init__.py shadows the one installed with python -mpip install . * CI: Use meson for openmp * MAINT: Add in rt similar to legacy_setup * ENH: Add in more options from legacy_setup * ENH: Try to setup the GPU variant * CI: Fix typo * MAINT: Try to explicitly take mkl * MAINT: More typos * MAINT: Try mkl again * CI: Rework * MAINT: Use configuration over CI
1 parent 1226a00 commit 3e7c427

File tree

7 files changed

+232
-164
lines changed

7 files changed

+232
-164
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ jobs:
2828
- uses: actions/checkout@v4
2929
with:
3030
submodules: recursive
31-
- uses: conda-incubator/setup-miniconda@v3
31+
- uses: prefix-dev/setup-[email protected]
3232
with:
33-
auto-update-conda: true
34-
python-version: ${{ matrix.python-version }}
35-
miniforge-version: latest
36-
channels: conda-forge,anaconda
33+
cache: false
34+
pixi-version: v0.46.0
35+
- name: Add .pixi/envs/default to the $PATH
36+
run: echo "$(pwd)/.pixi/envs/default/bin" >> $GITHUB_PATH
37+
shell: bash
3738
- name: Install dependencies
38-
run: |
39-
conda install scipy numpy pytest 'setuptools<=60'
39+
run: pixi add scipy numpy pip pytest meson meson-python openblas python==${{ matrix.python-version }}
4040
- name: Test
4141
run: |
42-
python legacy_setup.py install --scs --openmp
43-
pytest
42+
pixi r python -m pip install -v . --no-build-isolation -Csetup-args=-Duse_openmp=true
43+
pixi r pytest
4444
rm -rf build/
4545
4646
build_mkl:
@@ -53,7 +53,7 @@ jobs:
5353
matrix:
5454
# macos-13 runners have intel chips. macos-14 and above
5555
# runners have Apple silicon chips.
56-
os: [ ubuntu-latest, macos-13, windows-latest ]
56+
os: [ ubuntu-latest ]
5757
python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13"]
5858
link_mkl: [true]
5959

@@ -70,39 +70,33 @@ jobs:
7070
shell: bash
7171
run: |
7272
echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
73-
- uses: conda-incubator/setup-miniconda@v3
73+
- uses: prefix-dev/setup-[email protected]
7474
with:
75-
auto-update-conda: true
76-
python-version: ${{ matrix.python-version }}
77-
miniforge-version: latest
78-
channels: conda-forge,anaconda
75+
cache: false
76+
pixi-version: v0.46.0
77+
- name: Add .pixi/envs/default to the $PATH
78+
run: echo "$(pwd)/.pixi/envs/default/bin" >> $GITHUB_PATH
79+
shell: bash
7980
- name: Install dependencies
8081
run: |
8182
if [[ "$LINK_MKL" == "true" ]]; then
8283
BLAS_PKGS="blas-devel=*=*mkl"
8384
else
8485
BLAS_PKGS="blas-devel=*=*openblas"
8586
fi
86-
if [[ "$PYTHON_VERSION" == "3.9" ]]; then
87-
conda install scipy=1.5 numpy=1.19 pytest $BLAS_PKGS pkg-config
88-
elif [[ "$PYTHON_VERSION" == "3.10" ]]; then
89-
conda install scipy=1.7 numpy=1.21 pytest $BLAS_PKGS pkg-config
90-
elif [[ "$PYTHON_VERSION" == "3.11" ]]; then
91-
conda install scipy=1.9.3 numpy=1.23.4 pytest $BLAS_PKGS pkg-config
92-
elif [[ "$PYTHON_VERSION" == "3.12" || "$PYTHON_VERSION" == "3.13" ]]; then
93-
conda install scipy numpy pytest $BLAS_PKGS pkg-config
94-
fi
87+
pixi add $BLAS_PKGS pip scipy numpy pytest mkl mkl-devel pkg-config meson meson-python
9588
- name: Build
9689
run: |
97-
python -c "import numpy as np; print('NUMPY BLAS INFOS'); print(np.show_config())"
90+
pixi r python -c "import numpy as np;print(np.show_config())"
9891
if [[ "$LINK_MKL" == "true" ]]; then
99-
python -m pip install --verbose -Csetup-args=-Dlink_mkl=true .
92+
93+
pixi r python -m pip install --verbose --no-build-isolation -Csetup-args=-Dlink_mkl=true .
10094
else
101-
python -m pip install --verbose .
95+
pixi r python -m pip install --verbose --no-build-isolation .
10296
fi
10397
- name: Test
10498
run: |
105-
pytest
99+
pixi r pytest
106100
rm -rf build/
107101
108102
# from here to end it's a copy-paste, with few changes, of

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ out
4848
*.jar
4949
*.egg-info
5050
*.ipynb_checkpoints/
51+
52+
# pixi environments
53+
.pixi
54+
*.egg-info

0 commit comments

Comments
 (0)