Skip to content

Commit fa9db44

Browse files
committed
refactor: add tools, CI, fix to conform to ruff/pyright
1 parent e180c31 commit fa9db44

7 files changed

Lines changed: 430 additions & 116 deletions

File tree

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main", "master"]
6+
pull_request:
7+
branches: ["main", "master"]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
strategy:
16+
matrix:
17+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
18+
python-version: ["3.11", "3.12", "3.13"]
19+
20+
runs-on: ${{ matrix.os }}
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v5
28+
with:
29+
enable-cache: true
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Set up Python
33+
run: uv python install
34+
35+
- name: Install all dependencies
36+
run: uv sync --all-extras
37+
38+
- name: Run linting
39+
run: |
40+
uv run ruff format --check .
41+
uv run ruff check .
42+
43+
- name: Run type checking
44+
run: uv run pyright .
45+
46+
# Linux (Ubuntu)
47+
- name: Install MDBTools on Ubuntu
48+
if: runner.os == 'Linux'
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y mdbtools
52+
53+
# macOS (Homebrew)
54+
- name: Install MDBTools on macOS
55+
if: runner.os == 'macOS'
56+
run: |
57+
brew update
58+
brew install mdbtools
59+
60+
# Windows (MSYS2 + build from source)
61+
- name: Install MDBTools on Windows
62+
if: runner.os == 'Windows'
63+
shell: bash
64+
run: |
65+
choco install -y msys2
66+
C:\tools\msys64\usr\bin\bash -lc "
67+
pacman -Sy --noconfirm git base-devel mingw-w64-x86_64-toolchain automake autoconf libtool flex bison
68+
git clone https://github.com/mdbtools/mdbtools.git
69+
cd mdbtools
70+
autoreconf -i -f
71+
./configure --host=x86_64-w64-mingw32 --disable-shared --enable-static
72+
make -j$(nproc)
73+
make install
74+
"
75+
76+
- name: Run tests
77+
run: uv run pytest tests/

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
.venv
2+
.ruff_cache
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[cod]

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"[python]": {
3+
"editor.formatOnSave": true
4+
},
5+
"python.testing.pytestArgs": [
6+
"tests"
7+
],
8+
"python.testing.unittestEnabled": false,
9+
"python.testing.pytestEnabled": true
10+
}

pyproject.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
[project]
22
name = "polars_access_mdbtools"
33
version = "0.0.2"
4-
authors = [
5-
{ name="DeflateAwesome" },
6-
]
4+
authors = [{ name = "DeflateAwning" }]
75
description = "A library for reading tables from an Access database into Polars dataframes, using mdbtools"
86
readme = "README.md"
9-
requires-python = ">=3.8"
7+
requires-python = ">=3.11"
108
classifiers = [
119
"Programming Language :: Python :: 3",
1210
"License :: OSI Approved :: MIT License",
1311
"Operating System :: OS Independent",
1412
]
15-
dependencies = [
16-
"polars >= 0.20",
17-
]
18-
keywords = [
19-
"polars",
20-
"mdbtools",
21-
"access",
22-
"database",
23-
"dataframe",
24-
]
13+
dependencies = ["polars>=0.20"]
14+
keywords = ["polars", "mdbtools", "access", "database", "dataframe"]
2515

2616
[project.urls]
2717
Homepage = "https://github.com/DeflateAwning/polars_access_mdbtools"
@@ -31,3 +21,16 @@ License = "https://github.com/DeflateAwning/polars_access_mdbtools/blob/main/LIC
3121
[build-system]
3222
requires = ["hatchling"]
3323
build-backend = "hatchling.build"
24+
25+
[dependency-groups]
26+
dev = ["pyright>=1.1.406", "pytest>=8.4.2", "ruff>=0.14.1"]
27+
28+
[tool.pyright]
29+
typeCheckingMode = "strict"
30+
31+
[tool.ruff.lint]
32+
select = ["ALL"]
33+
ignore = [
34+
"FIX002",
35+
"TD003", # Needs issue link.
36+
]

0 commit comments

Comments
 (0)