Skip to content

Commit 261de5e

Browse files
committed
Simplify test setup
1 parent a4d801c commit 261de5e

1 file changed

Lines changed: 91 additions & 26 deletions

File tree

.github/workflows/tests.yml

Lines changed: 91 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,109 @@ 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
55-
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
50+
vcpkg install gsl:x64-windows
51+
# Add GSL DLL directory to PATH for runtime
52+
$vcpkgRoot = $env:VCPKG_INSTALLATION_ROOT
53+
if (-not $vcpkgRoot) { $vcpkgRoot = "C:\vcpkg" }
54+
$gslBinPath = Join-Path $vcpkgRoot "installed\x64-windows\bin"
55+
echo "$gslBinPath" >> $env:GITHUB_PATH
56+
Write-Output "Added to PATH: $gslBinPath"
57+
shell: powershell
58+
59+
- name: Install GSL (Ubuntu)
60+
if: matrix.os == 'ubuntu-24.04'
61+
run: sudo apt-get update && sudo apt-get install -y libgsl-dev
6062

61-
- name: Install uv
63+
- name: Install uv and set the python version
6264
uses: astral-sh/setup-uv@v6
6365
with:
66+
python-version: ${{ matrix.python }}
6467
version: "0.8.15"
6568

6669
- name: Install pip deps
67-
shell: bash -l {0}
6870
run: |
71+
uv venv
6972
uv pip install -r pyproject.toml --extra test
7073
7174
- name: Build module
72-
env:
73-
MSP_CONDA_PREFIX: c:\Miniconda\envs\anaconda-client-env
7475
run: |
75-
source ~/.profile
76-
conda activate anaconda-client-env
77-
python setup.py build_ext --inplace
76+
uv run --no-sync python setup.py build_ext --inplace
77+
78+
- name: Analyze DLL dependencies (Windows)
79+
if: matrix.os == 'windows-latest'
80+
run: |
81+
# First, let's see what files were actually created
82+
Write-Output "=== All .pyd files in directory ==="
83+
Get-ChildItem -Recurse -Name "*.pyd"
84+
85+
Write-Output "=== All files matching *msprime* ==="
86+
Get-ChildItem -Recurse -Name "*msprime*"
87+
88+
Write-Output "=== Contents of msprime directory ==="
89+
if (Test-Path "msprime") {
90+
Get-ChildItem "msprime" -Name
91+
} else {
92+
Write-Output "msprime directory not found"
93+
}
94+
95+
# Find the built extension - try multiple patterns
96+
$extension = Get-ChildItem -Recurse -Name "*.pyd" | Where-Object { $_ -like "*msprime*" } | Select-Object -First 1
97+
Write-Output "Found extension: $extension"
98+
99+
if ($extension) {
100+
# Get full path
101+
$extensionPath = Get-ChildItem -Recurse "*.pyd" | Where-Object { $_.Name -like "*msprime*" } | Select-Object -First 1 -ExpandProperty FullName
102+
Write-Output "Extension full path: $extensionPath"
103+
104+
# Download Dependency Walker
105+
Write-Output "=== Downloading Dependency Walker ==="
106+
Invoke-WebRequest -Uri "http://www.dependencywalker.com/depends22_x64.zip" -OutFile "depends.zip"
107+
Expand-Archive depends.zip -DestinationPath "depends"
108+
109+
# Run dependency walker
110+
Write-Output "=== Running Dependency Walker ==="
111+
.\depends\depends.exe /c /f:1 /ot:deps.txt "$extensionPath"
112+
Start-Sleep -Seconds 5 # Give it time to complete
113+
114+
# Output the full dependency analysis
115+
if (Test-Path "deps.txt") {
116+
Write-Output "=== Dependency Walker Analysis ==="
117+
Get-Content deps.txt
118+
Write-Output "=== End Analysis ==="
119+
} else {
120+
Write-Output "deps.txt not created - Dependency Walker may have failed"
121+
Write-Output "=== Simple Import Test ==="
122+
try {
123+
python -c "import msprime._msprime; print('SUCCESS')"
124+
} catch {
125+
Write-Output "Import failed: $($_.Exception.Message)"
126+
}
127+
}
128+
129+
# Check if GSL DLLs are in PATH
130+
Write-Output "=== GSL DLL Check ==="
131+
$env:PATH.Split(';') | ForEach-Object {
132+
$dir = $_.Trim()
133+
if ($dir -and (Test-Path $dir)) {
134+
$gslDlls = Get-ChildItem -Path $dir -Name "gsl*.dll" -ErrorAction SilentlyContinue
135+
if ($gslDlls) {
136+
Write-Output "Found GSL DLLs in ${dir}:"
137+
$gslDlls | ForEach-Object { Write-Output " $_" }
138+
}
139+
}
140+
}
141+
} else {
142+
Write-Output "ERROR: Could not find any msprime extension"
143+
}
144+
shell: powershell
78145

79146
- name: Run tests
80147
run: |
81-
source ~/.profile
82-
conda activate anaconda-client-env
83-
pytest -xvs -n0
148+
uv run --no-sync pytest -xvs -n0

0 commit comments

Comments
 (0)