diff --git a/Makefile b/Makefile index bece7d1b..300be418 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ install: - pip install -e ".[dev]" --config-settings editable_mode=compat + pip install -e ".[dev]" bash .github/setup_env.sh debug: @@ -31,6 +31,6 @@ deploy: changelog: build-changelog changelog.yaml --output changelog.yaml --update-last-date --start-from 0.1.0 --append-file changelog_entry.yaml build-changelog changelog.yaml --org PolicyEngine --repo policyengine-api --output CHANGELOG.md --template .github/changelog_template.md - bump-version changelog.yaml setup.py policyengine_api/constants.py + bump-version changelog.yaml pyproject.toml policyengine_api/constants.py rm changelog_entry.yaml || true touch changelog_entry.yaml \ No newline at end of file diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..0c4e4fb3 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + changed: + - Migrated from setup.py to pyproject.toml with hatchling build backend diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..5551b70f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "policyengine-api" +version = "3.37.0" +description = "PolicyEngine API" +readme = "README.md" +license = "AGPL-3.0-only" +authors = [ + { name = "PolicyEngine", email = "hello@policyengine.org" }, +] +requires-python = ">=3.11" +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "License :: OSI Approved :: GNU Affero General Public License v3", +] +dependencies = [ + "anthropic", + "assertpy", + "click>=8,<9", + "cloud-sql-python-connector", + "faiss-cpu", + "flask>=3,<4", + "flask-cors>=5,<6", + "Flask-Caching>=2,<3", + "google-cloud-logging>=3,<4", + "gunicorn", + "httpx>=0.27.0", + "markupsafe>=3,<4", + "microdf_python>=1.0.0", + "openai", + "policyengine_canada==0.96.3", + "policyengine-ng==0.5.1", + "policyengine-il==0.1.0", + "policyengine_uk==2.39.0", + "policyengine_us==1.590.2", + "policyengine_core>=3.16.6", + "policyengine>=0.7.0", + "pydantic", + "pymysql", + "python-dotenv", + "redis", + "rq", + "sqlalchemy>=2,<3", + "streamlit", + "werkzeug", +] + +[project.optional-dependencies] +dev = [ + "pytest-timeout", + "coverage", + "pytest-snapshot", + "ruff>=0.9.0", +] + +[project.scripts] +policyengine-api-setup = "policyengine_api.setup_data:setup_data" + +[tool.hatch.build.targets.wheel] +packages = ["policyengine_api"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 031b17ec..00000000 --- a/setup.py +++ /dev/null @@ -1,61 +0,0 @@ -from setuptools import setup, find_packages -from policyengine_api.constants import __version__ - -setup( - name="policyengine-api", - version=__version__, - author="PolicyEngine", - author_email="hello@policyengine.org", - description="PolicyEngine API", - packages=find_packages(), - python_requires=">=3.11", - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "License :: OSI Approved :: GNU Affero General Public License v3", - ], - install_requires=[ - "anthropic", - "assertpy", - "click>=8,<9", - "cloud-sql-python-connector", - "faiss-cpu", - "flask>=3,<4", - "flask-cors>=5,<6", - "google-cloud-logging", - "gunicorn", - "httpx>=0.27.0", - "markupsafe>=3,<4", - "openai", - "policyengine_canada==0.96.3", - "policyengine-ng==0.5.1", - "policyengine-il==0.1.0", - "policyengine_uk==2.39.0", - "policyengine_us==1.590.2", - "policyengine_core>=3.16.6", - "policyengine>=0.7.0", - "pydantic", - "pymysql", - "python-dotenv", - "redis", - "rq", - "sqlalchemy>=2,<3", - "streamlit", - "werkzeug", - "Flask-Caching>=2,<3", - "google-cloud-logging>=3,<4", - "microdf_python>=1.0.0", - ], - extras_require={ - "dev": ["pytest-timeout", "coverage", "pytest-snapshot", "ruff>=0.9.0"], - }, - # script policyengine-api-setup -> policyengine_api.setup_data:setup_data - entry_points={ - "console_scripts": [ - "policyengine-api-setup=policyengine_api.setup_data:setup_data", - ], - }, -)