Skip to content

Commit 182e8bd

Browse files
committed
ci(publish): add macOS and linux universal wheel builds
- build macOS arm64 + x86_64 wheels via target matrix and maturin `-i pythonX.Y` - drop `pydantic` extra; update docs to install pydantic separately and mark FastAPI/SQLAlchemy as coming soon - add pydantic to dev deps and update lockfile
1 parent 303f31c commit 182e8bd

File tree

6 files changed

+104
-59
lines changed

6 files changed

+104
-59
lines changed

.github/workflows/publish.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,47 @@ jobs:
4949
5050
5151
build-wheels:
52-
name: Build wheels (${{ matrix.os }}, py${{ matrix.python-version }})
52+
name: Build wheels (${{ matrix.os }}, ${{ matrix.target || 'native' }}, py${{ matrix.python-version }})
5353
runs-on: ${{ matrix.os }}
5454
needs: [test-native]
5555
strategy:
5656
fail-fast: false
5757
matrix:
58-
os: [ubuntu-latest, macos-latest, windows-latest]
58+
os: [ubuntu-latest, windows-latest]
5959
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
60+
include:
61+
# macOS ARM64 (native on macos-latest which is ARM)
62+
- os: macos-latest
63+
target: aarch64-apple-darwin
64+
python-version: "3.10"
65+
- os: macos-latest
66+
target: aarch64-apple-darwin
67+
python-version: "3.11"
68+
- os: macos-latest
69+
target: aarch64-apple-darwin
70+
python-version: "3.12"
71+
- os: macos-latest
72+
target: aarch64-apple-darwin
73+
python-version: "3.13"
74+
- os: macos-latest
75+
target: aarch64-apple-darwin
76+
python-version: "3.14"
77+
# macOS x86_64 (cross-compile from ARM runner)
78+
- os: macos-latest
79+
target: x86_64-apple-darwin
80+
python-version: "3.10"
81+
- os: macos-latest
82+
target: x86_64-apple-darwin
83+
python-version: "3.11"
84+
- os: macos-latest
85+
target: x86_64-apple-darwin
86+
python-version: "3.12"
87+
- os: macos-latest
88+
target: x86_64-apple-darwin
89+
python-version: "3.13"
90+
- os: macos-latest
91+
target: x86_64-apple-darwin
92+
python-version: "3.14"
6093

6194
steps:
6295
- name: Checkout
@@ -71,19 +104,22 @@ jobs:
71104

72105
- name: Install Rust
73106
uses: dtolnay/rust-toolchain@stable
107+
with:
108+
targets: ${{ matrix.target }}
74109

75110
# Build typeid-python wheel (includes rust extension)
76111
- name: Build wheels (maturin)
77112
uses: PyO3/maturin-action@v1
78113
with:
79114
command: build
80-
args: --release --out dist
115+
args: --release --out dist -i python${{ matrix.python-version }}
116+
target: ${{ matrix.target }}
81117
manylinux: "2_28"
82118

83119
- name: Upload wheels
84120
uses: actions/upload-artifact@v4
85121
with:
86-
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
122+
name: wheels-${{ matrix.os }}-${{ matrix.target || 'native' }}-py${{ matrix.python-version }}
87123
path: dist/*.whl
88124

89125
build-sdist:
@@ -138,6 +174,7 @@ jobs:
138174
uses: pypa/gh-action-pypi-publish@release/v1
139175
with:
140176
packages-dir: out
177+
repository-url: https://test.pypi.org/legacy/
141178

142179
publish-docs:
143180
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ Included:
7575
```console
7676
$ pip install typeid-python[yaml] # YAML schema support
7777
$ pip install typeid-python[cli] # CLI tools
78-
$ pip install typeid-python[pydantic] # Pydantic integration
7978
```
8079

8180
Extras are **strictly optional**.
@@ -163,10 +162,6 @@ Integrations are provided as optional adapters, installed explicitly and kept se
163162
* **Pydantic (v2)**
164163
Native field type with validation and JSON Schema support.
165164

166-
```bash
167-
pip install typeid-python[pydantic]
168-
```
169-
170165
```python
171166
from typing import Literal
172167
from pydantic import BaseModel
@@ -176,19 +171,9 @@ Integrations are provided as optional adapters, installed explicitly and kept se
176171
id: TypeIDField[Literal["user"]]
177172
```
178173

179-
* **FastAPI**
180-
Works automatically via Pydantic (request/response models, OpenAPI).
181-
182-
```bash
183-
pip install typeid-python[fastapi]
184-
```
185-
186-
* **SQLAlchemy**
187-
Column types for storing TypeIDs (typically as strings).
174+
* **FastAPI** (Coming Soon 🚧)
188175

189-
```bash
190-
pip install typeid-python[sqlalchemy]
191-
```
176+
* **SQLAlchemy** (Coming Soon 🚧)
192177

193178
All integrations are **opt-in via extras** and never affect the core package.
194179

docs/integrations/index.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Native support for using TypeID in Pydantic v2 models.
2020
* Clean JSON Schema / OpenAPI output
2121

2222
```bash
23-
pip install typeid-python[pydantic]
23+
pip install typeid-python pydantic
2424
```
2525

2626
See: [Pydantic v2](https://akhundmurad.github.io/typeid-python/integrations/pydantic/) documentation page for details and examples.
2727

28-
### FastAPI
28+
### FastAPI (Coming Soon 🚧)
2929

3030
FastAPI builds on Pydantic v2, so TypeID works automatically in:
3131

@@ -35,24 +35,10 @@ FastAPI builds on Pydantic v2, so TypeID works automatically in:
3535

3636
No separate FastAPI-specific adapter is required.
3737

38-
```bash
39-
pip install typeid-python[fastapi]
40-
```
41-
42-
See: [Pydantic v2](https://akhundmurad.github.io/typeid-python/integrations/fastapi/) documentation page for details and examples.
43-
44-
### SQLAlchemy
38+
### SQLAlchemy (Coming Soon 🚧)
4539

4640
Column types for storing TypeIDs in relational databases.
4741

48-
Typical usage stores the full TypeID string (`prefix_suffix`) for clarity and debuggability.
49-
50-
```bash
51-
pip install typeid-python[sqlalchemy]
52-
```
53-
54-
See: [Pydantic v2](https://akhundmurad.github.io/typeid-python/integrations/sqlalchemy/) documentation page for details and examples.
55-
5642
## Design notes
5743

5844
* The TypeID core never imports framework code

docs/integrations/pydantic.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ The adapter:
1212

1313
---
1414

15-
## Installation
16-
17-
```bash
18-
pip install typeid-python[pydantic]
19-
```
20-
21-
This installs the latest version of Pydantic v2.
22-
2315
## Basic usage
2416

2517
Use `TypeIDField` with a fixed prefix.
@@ -161,13 +153,6 @@ This works cleanly with:
161153
Using `Literal` makes the prefix a real compile-time constant and avoids
162154
annotation edge cases.
163155

164-
## FastAPI
165-
166-
FastAPI uses Pydantic v2, so no extra integration is needed.
167-
168-
TypeID fields work automatically in request and response models,
169-
including OpenAPI output, as soon as you use them in a Pydantic model.
170-
171156
## Design notes
172157

173158
* The TypeID core does not import Pydantic.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dependencies = ["uuid-utils>=0.12.0"]
2222
[project.optional-dependencies]
2323
cli = ["click"]
2424
yaml = ["PyYAML"]
25-
pydantic = ["pydantic>=2,<3"]
2625

2726
[project.urls]
2827
Homepage = "https://github.com/akhundMurad/typeid-python"
@@ -51,6 +50,8 @@ dev = [
5150
"pytest-benchmark>=5.0.1",
5251
"maturin>=1.5; platform_system != 'Windows'",
5352
"pre-commit>=4.5.1",
53+
"httpx>=0.28.1",
54+
"pydantic>=2,<3",
5455
]
5556

5657
[tool.black]

uv.lock

Lines changed: 56 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)