Skip to content

Commit 717b72a

Browse files
ci: fix Windows mdbtools install (#2)
* ci: fix Windows mdbtools install * ci: fix Windows uv sync install * ci: remove mandb on Linux * ci: add 10-minute timeout
1 parent 95166fe commit 717b72a

3 files changed

Lines changed: 47 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ permissions:
1212

1313
jobs:
1414
build:
15+
timeout-minutes: 10
1516
strategy:
1617
matrix:
1718
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
@@ -49,7 +50,8 @@ jobs:
4950
- name: Set up Python
5051
run: uv python install
5152

52-
- name: Install dependencies
53+
- name: Install uv dependencies
54+
if: runner.os == 'Linux' || runner.os == 'macOS'
5355
run: |
5456
if [ -n "${{ matrix.polars-version || '' }}" ]; then
5557
echo "Overriding Polars version to ${{ matrix.polars-version }}"
@@ -58,6 +60,17 @@ jobs:
5860
else
5961
uv sync --all-extras
6062
fi
63+
- name: Install uv dependencies (Windows)
64+
if: runner.os == 'Windows'
65+
run: |
66+
if ($env:MATRIX_POLARS_VERSION) {
67+
Write-Host "Overriding Polars version to $env:MATRIX_POLARS_VERSION"
68+
uv lock --upgrade-package polars==$env:MATRIX_POLARS_VERSION
69+
uv sync --all-extras
70+
} else {
71+
uv sync --all-extras
72+
}
73+
shell: pwsh
6174

6275
- name: Run linting
6376
run: |
@@ -71,6 +84,9 @@ jobs:
7184
- name: Install MDBTools on Ubuntu
7285
if: runner.os == 'Linux'
7386
run: |
87+
# Remove mandb (to speed up apt installs).
88+
sudo apt-get remove -y mandb || true
89+
sudo rm -f /var/lib/man-db/auto-update
7490
sudo apt-get update
7591
sudo apt-get install -y mdbtools
7692
@@ -81,21 +97,25 @@ jobs:
8197
brew update
8298
brew install mdbtools
8399
84-
# Windows (MSYS2 + build from source)
100+
# Windows (download from build at https://github.com/lsgunth/mdbtools-win)
85101
- name: Install MDBTools on Windows
86102
if: runner.os == 'Windows'
87-
shell: bash
88103
run: |
89-
choco install -y msys2
90-
C:\tools\msys64\usr\bin\bash -lc "
91-
pacman -Sy --noconfirm git base-devel mingw-w64-x86_64-toolchain automake autoconf libtool flex bison
92-
git clone https://github.com/mdbtools/mdbtools.git
93-
cd mdbtools
94-
autoreconf -i -f
95-
./configure --host=x86_64-w64-mingw32 --disable-shared --enable-static
96-
make -j$(nproc)
97-
make install
98-
"
104+
$url = "https://github.com/lsgunth/mdbtools-win/archive/refs/tags/v1.0.0.zip"
105+
$zipPath = "$env:RUNNER_TEMP\mdbtools-win.zip"
106+
$extractPath = "$env:GITHUB_WORKSPACE\path"
107+
108+
# Download the zip file
109+
Invoke-WebRequest -Uri $url -OutFile $zipPath
110+
111+
# Create the target directory if it doesn't exist
112+
New-Item -ItemType Directory -Force -Path $extractPath | Out-Null
113+
114+
# Extract the zip file
115+
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
116+
117+
Write-Host "Extracted to $extractPath"
118+
shell: pwsh
99119

100120
- name: Run tests
101121
run: uv run pytest tests/

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,11 @@ typeCheckingMode = "strict"
3232
select = ["ALL"]
3333
ignore = [
3434
"FIX002",
35-
"TD003", # Needs issue link.
36-
]
35+
"TD003", # Needs issue link.
36+
]
37+
38+
[tool.ruff.lint.per-file-ignores]
39+
"tests/**/*.py" = [
40+
"D103", # Missing docstring in public function.
41+
"S101", # Allows asserts.
42+
]

tests/test_read_table.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Tests for reading tables from Access databases."""
2+
3+
4+
def test_placeholder() -> None:
5+
"""A placeholder test."""
6+
assert True

0 commit comments

Comments
 (0)