Skip to content

Commit aefd35e

Browse files
committed
refactor: Move from setuptools to uv
Previously, we were using setuptools via a setup.py file and various requirements*.txt files. This updates the package to the more modern pyproject.toml file and switches our build system to uv. Additionally, the package was previously a top level package, which improves testability since the package will no longer be automatically added to sys.path. This change will improve both our developer experience and the packages reproducibility.
1 parent f9e5359 commit aefd35e

File tree

139 files changed

+1475
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+1475
-111
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,25 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
2121
steps:
2222
- uses: actions/checkout@v3
23-
- uses: actions/setup-python@v5
23+
- uses: astral-sh/setup-uv@v7
2424
with:
2525
python-version: ${{ matrix.python }}
26-
cache: "pip"
27-
cache-dependency-path: setup.py
26+
enable-cache: true
2827

2928
- name: Install dependencies
30-
run: |
31-
pip install -e .[dev]
29+
run: uv sync --locked --dev
3230

3331
- name: Check formatting
34-
run: black --check .
32+
run: uv run ruff format --check .
3533

3634
- name: Lint
37-
run: |
38-
flake8 . --extend-exclude .devbox --count --select=E9,F7,F82 --show-source --statistics
39-
flake8 . --extend-exclude .devbox --count --exit-zero --max-complexity=10 --statistics
35+
run: uv run ruff check --extend-exclude .devbox
4036

4137
- name: Type Check
42-
run: mypy
38+
run: uv run mypy
4339

4440
- name: Test
45-
run: python -m pytest
41+
run: uv run pytest

CLAUDE.md

Lines changed: 25 additions & 11 deletions

README.md

Lines changed: 1 addition & 1 deletion

mypy.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

pyproject.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
[project]
2+
name = "workos"
3+
version = "5.32.0"
4+
description = "WorkOS Python Client"
5+
readme = "README.md"
6+
license = "MIT"
7+
authors = [{ name = "WorkOS", email = "team@workos.com" }]
8+
requires-python = ">=3.8"
9+
10+
dependencies = [
11+
"cryptography>=44.0.2",
12+
"httpx~=0.28.1",
13+
"pydantic>=2.10.4",
14+
"pyjwt>=2.10.0 ; python_full_version >= '3.9'",
15+
"pyjwt>=2.9.0,<2.10 ; python_full_version == '3.8.*'",
16+
]
17+
18+
[project.urls]
19+
Homepage = "https://workos.com/docs/sdks/python"
20+
Documentation = "https://workos.com/docs/reference"
21+
Changelog = "https://workos.com/docs/sdks/python"
22+
23+
[dependency-groups]
24+
dev = [
25+
{ include-group = "test" },
26+
{ include-group = "lint" },
27+
{ include-group = "type_check" },
28+
]
29+
test = [
30+
"pytest==8.3.4",
31+
"pytest-asyncio==0.23.8",
32+
"pytest-cov==5.0.0",
33+
"six==1.17.0",
34+
]
35+
lint = ["ruff==0.14.5"]
36+
type_check = ["mypy==1.14.1"]
37+
38+
39+
[tool.mypy]
40+
packages = "workos"
41+
warn_return_any = true
42+
warn_unused_configs = true
43+
warn_unreachable = true
44+
warn_redundant_casts = true
45+
warn_no_return = true
46+
warn_unused_ignores = true
47+
implicit_reexport = true
48+
strict_equality = true
49+
strict = true
50+
51+
[tool.ruff.lint.per-file-ignores]
52+
"*/__init__.py" = ["F401", "F403"]
53+
54+
[tool.ruff.lint.mccabe]
55+
max-complexity = 10
56+
57+
[tool.uv.build-backend]
58+
source-include = ["py.typed"]
59+
source-exclude = ["tests*"]
60+
61+
[build-system]
62+
requires = ["uv_build>=0.8.15,<0.9.0"]
63+
build-backend = "uv_build"

requirements-dev.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/build_and_upload_dist.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# Clean out the dist directory so only the current release gets uploaded
33
rm dist/*
44

5-
# Build the distribution
6-
python3 setup.py sdist bdist_wheel
5+
# Build the package using uv
6+
uv build --sdist --wheel
7+
8+
# Upload the distribution to PyPi via uv
9+
uv publish
710

8-
# Upload the distribution to PyPi via twine
9-
twine upload dist/*

setup.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)