Skip to content

Commit 3638b62

Browse files
MaxGhenisclaude
andauthored
Migrate from setup.py to pyproject.toml (#3319)
* Migrate from setup.py to pyproject.toml with hatchling Modernize build configuration to use pyproject.toml, consistent with other PolicyEngine repositories. All dependencies, entry points, and metadata preserved. Updated Makefile references accordingly. Co-Authored-By: Claude Opus 4.6 <[email protected]> * Add hatch wheel packages config for package discovery Hatchling requires explicit package listing when there is no __init__.py in the package directory. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 26738ae commit 3638b62

File tree

4 files changed

+73
-63
lines changed

4 files changed

+73
-63
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
install:
2-
pip install -e ".[dev]" --config-settings editable_mode=compat
2+
pip install -e ".[dev]"
33
bash .github/setup_env.sh
44

55
debug:
@@ -31,6 +31,6 @@ deploy:
3131
changelog:
3232
build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.1.0 --append-file changelog_entry.yaml
3333
build-changelog changelog.yaml --org PolicyEngine --repo policyengine-api --output CHANGELOG.md --template .github/changelog_template.md
34-
bump-version changelog.yaml setup.py policyengine_api/constants.py
34+
bump-version changelog.yaml pyproject.toml policyengine_api/constants.py
3535
rm changelog_entry.yaml || true
3636
touch changelog_entry.yaml

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: minor
2+
changes:
3+
changed:
4+
- Migrated from setup.py to pyproject.toml with hatchling build backend

pyproject.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "policyengine-api"
7+
version = "3.37.0"
8+
description = "PolicyEngine API"
9+
readme = "README.md"
10+
license = "AGPL-3.0-only"
11+
authors = [
12+
{ name = "PolicyEngine", email = "[email protected]" },
13+
]
14+
requires-python = ">=3.11"
15+
classifiers = [
16+
"Programming Language :: Python :: 3",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
21+
"License :: OSI Approved :: GNU Affero General Public License v3",
22+
]
23+
dependencies = [
24+
"anthropic",
25+
"assertpy",
26+
"click>=8,<9",
27+
"cloud-sql-python-connector",
28+
"faiss-cpu",
29+
"flask>=3,<4",
30+
"flask-cors>=5,<6",
31+
"Flask-Caching>=2,<3",
32+
"google-cloud-logging>=3,<4",
33+
"gunicorn",
34+
"httpx>=0.27.0",
35+
"markupsafe>=3,<4",
36+
"microdf_python>=1.0.0",
37+
"openai",
38+
"policyengine_canada==0.96.3",
39+
"policyengine-ng==0.5.1",
40+
"policyengine-il==0.1.0",
41+
"policyengine_uk==2.39.0",
42+
"policyengine_us==1.590.2",
43+
"policyengine_core>=3.16.6",
44+
"policyengine>=0.7.0",
45+
"pydantic",
46+
"pymysql",
47+
"python-dotenv",
48+
"redis",
49+
"rq",
50+
"sqlalchemy>=2,<3",
51+
"streamlit",
52+
"werkzeug",
53+
]
54+
55+
[project.optional-dependencies]
56+
dev = [
57+
"pytest-timeout",
58+
"coverage",
59+
"pytest-snapshot",
60+
"ruff>=0.9.0",
61+
]
62+
63+
[project.scripts]
64+
policyengine-api-setup = "policyengine_api.setup_data:setup_data"
65+
66+
[tool.hatch.build.targets.wheel]
67+
packages = ["policyengine_api"]

setup.py

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

0 commit comments

Comments
 (0)