1+ name : Test Build Configuration
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ test_os :
7+ description : ' OS to test (or "all")'
8+ required : false
9+ default : ' ubuntu-latest'
10+ type : choice
11+ options :
12+ - ' all'
13+ - ' ubuntu-latest'
14+ - ' windows-latest'
15+ - ' macos-latest'
16+ - ' macos-13'
17+ test_python :
18+ description : ' Python version to test (or "all")'
19+ required : false
20+ default : ' 3.12'
21+ type : choice
22+ options :
23+ - ' all'
24+ - ' 3.9'
25+ - ' 3.10'
26+ - ' 3.11'
27+ - ' 3.12'
28+ - ' 3.13'
29+ pull_request :
30+ paths :
31+ - ' .github/workflows/publish.yml'
32+ - ' pyproject.toml'
33+
34+ jobs :
35+ test-standard-build :
36+ name : Test Std ${{ matrix.os }} py${{ matrix.python-version }}
37+ strategy :
38+ fail-fast : false
39+ matrix :
40+ os : [ubuntu-latest, windows-latest, macos-latest, macos-13]
41+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
42+ exclude :
43+ - os : macos-13
44+ python-version : " 3.13"
45+ - os : windows-latest
46+ python-version : " 3.9"
47+ runs-on : ${{ matrix.os }}
48+ steps :
49+ - name : Check out repository
50+ uses : actions/checkout@v4
51+
52+ - name : Install uv
53+ uses : astral-sh/setup-uv@v4
54+
55+ - name : Set up Python ${{ matrix.python-version }}
56+ run : uv python install ${{ matrix.python-version }}
57+
58+ - name : Install dependencies
59+ run : uv sync --extra performance --group build
60+
61+ - name : Build standard wheel
62+ run : uv build --wheel
63+
64+ - name : Test wheel installation
65+ run : |
66+ uv venv test-env --python ${{ matrix.python-version }}
67+ uv pip install --python test-env --find-links dist/ sqlspec
68+ uv run --python test-env python -c "import sqlspec; print('Standard wheel test passed')"
69+
70+ test-mypyc-build :
71+ name : Test MyPyC ${{ matrix.os }} py${{ matrix.python-version }}
72+ strategy :
73+ fail-fast : false
74+ matrix :
75+ os : [ubuntu-latest, windows-latest, macos-latest, macos-13]
76+ python-version : ["3.9", "3.10", "3.11", "3.12", "3.13"]
77+ exclude :
78+ - os : windows-latest
79+ python-version : " 3.9"
80+ - os : macos-13
81+ python-version : " 3.13"
82+ runs-on : ${{ matrix.os }}
83+ steps :
84+ - name : Check out repository
85+ uses : actions/checkout@v4
86+
87+ - name : Install uv
88+ uses : astral-sh/setup-uv@v4
89+
90+ - name : Set up Python ${{ matrix.python-version }}
91+ run : uv python install ${{ matrix.python-version }}
92+
93+ - name : Install dependencies with mypyc
94+ run : uv sync --extra performance --group build
95+
96+ - name : Build MyPyC wheel
97+ run : uv build --wheel
98+ env :
99+ HATCH_BUILD_HOOKS_ENABLE : " 1"
100+
101+ - name : Rename wheel with mypyc tag
102+ run : |
103+ for wheel in dist/*.whl; do
104+ if [[ -f "$wheel" ]]; then
105+ base=$(basename "$wheel" .whl)
106+ dir=$(dirname "$wheel")
107+ mv "$wheel" "$dir/${base}+mypyc.whl"
108+ fi
109+ done
110+
111+ - name : Test mypyc wheel installation
112+ run : |
113+ uv venv test-env --python ${{ matrix.python-version }}
114+ uv pip install --python test-env --find-links dist/ sqlspec
115+ uv run --python test-env python -c "import sqlspec; print('MyPyC wheel test passed')"
116+
117+ - name : Verify wheel integrity
118+ run : |
119+ uv tool install twine
120+ uv tool run twine check dist/*
0 commit comments