Skip to content

Commit 776637a

Browse files
committed
Simplify test setup
1 parent a4d801c commit 776637a

File tree

1 file changed

+40
-26
lines changed

1 file changed

+40
-26
lines changed

.github/workflows/tests.yml

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ jobs:
3232
with:
3333
submodules: true
3434

35-
- name: Install Conda (needed for GSL)
36-
uses: conda-incubator/setup-miniconda@v3.1.1
37-
with:
38-
activate-environment: anaconda-client-env
39-
python-version: ${{ matrix.python }}
40-
channels: conda-forge, anaconda
41-
channel-priority: strict
42-
auto-update-conda: true
4335

4436
- name: Fix windows symlinks
4537
# This is horrible, but the "git config core.symlinks true" didn't work.
@@ -48,36 +40,58 @@ jobs:
4840
rm lwt_interface
4941
cp -r --dereference git-submodules/tskit/python/lwt_interface ./lwt_interface
5042
51-
- name: Fix windows .profile
52-
if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest'
43+
- name: Install GSL (macOS)
44+
if: matrix.os == 'macos-latest'
45+
run: brew install gsl
46+
47+
- name: Install GSL (Windows)
48+
if: matrix.os == 'windows-latest'
5349
run: |
54-
cp ~/.bash_profile ~/.profile
50+
vcpkg install gsl:x64-windows
51+
shell: powershell
52+
53+
- name: Install GSL (Ubuntu)
54+
if: matrix.os == 'ubuntu-24.04'
55+
run: sudo apt-get update && sudo apt-get install -y libgsl-dev
5556

56-
- name: Install GSL
57-
if: steps.cache.outputs.cache-hit != 'true'
58-
shell: bash -l {0} #We need a login shell to get conda
59-
run: conda install gsl
60-
61-
- name: Install uv
57+
- name: Install uv and set the python version
6258
uses: astral-sh/setup-uv@v6
6359
with:
60+
python-version: ${{ matrix.python }}
6461
version: "0.8.15"
6562

6663
- name: Install pip deps
67-
shell: bash -l {0}
6864
run: |
65+
uv venv
6966
uv pip install -r pyproject.toml --extra test
7067
68+
- name: Install Windows build tools
69+
if: matrix.os == 'windows-latest'
70+
run: |
71+
uv pip install build delvewheel
72+
7173
- name: Build module
72-
env:
73-
MSP_CONDA_PREFIX: c:\Miniconda\envs\anaconda-client-env
74+
if: matrix.os != 'windows-latest'
75+
run: |
76+
uv run --no-sync python setup.py build_ext --inplace
77+
78+
- name: Build and install repaired wheel (Windows)
79+
if: matrix.os == 'windows-latest'
80+
shell: powershell
7481
run: |
75-
source ~/.profile
76-
conda activate anaconda-client-env
77-
python setup.py build_ext --inplace
82+
# Build wheel
83+
uv run --no-sync python -m build --wheel
84+
85+
# Repair wheel with delvewheel (bundle DLLs)
86+
$vcpkgRoot = $env:VCPKG_ROOT
87+
if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
88+
$gslBinPath = Join-Path $vcpkgRoot "installed\x64-windows\bin"
89+
uv run --no-sync delvewheel repair dist/*.whl -w repaired_wheel/ --add-path "$gslBinPath"
90+
91+
# Install the repaired wheel
92+
uv pip install (Get-ChildItem repaired_wheel\*.whl | Select-Object -First 1).FullName --force-reinstall
93+
7894
7995
- name: Run tests
8096
run: |
81-
source ~/.profile
82-
conda activate anaconda-client-env
83-
pytest -xvs -n0
97+
uv run --no-sync pytest -xvs -n0

0 commit comments

Comments
 (0)