From bf84594a8a8cb9efff0d505a5f3e97a651cb26d9 Mon Sep 17 00:00:00 2001 From: Kaxil Naik Date: Wed, 28 Dec 2022 21:16:08 +0000 Subject: [PATCH] Use Hatch instead of Flit for building the project Similar to https://github.com/psf/black/pull/3233 , let's witch to Hatch that is more powerful and lets use use fancy-pypi-readme --- python-sdk/pyproject.toml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/python-sdk/pyproject.toml b/python-sdk/pyproject.toml index 5e2e338aa1..01339d3561 100644 --- a/python-sdk/pyproject.toml +++ b/python-sdk/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["flit_core ~=3.2"] -build-backend = "flit_core.buildapi" +requires = ["hatchling>=1.8.0", "hatch-fancy-pypi-readme"] +build-backend = "hatchling.build" [project] name = "astro-sdk-python" -dynamic = ["version"] +dynamic = ["readme", "version"] description = """ Astro SDK allows rapid and clean development of {Extract, Load, Transform} workflows using Python and SQL, powered by Apache Airflow. """ @@ -12,8 +12,7 @@ Astro SDK allows rapid and clean development of {Extract, Load, Transform} workf authors = [ { name = "Astronomer", email = "humans@astronomer.io" }, ] -readme = "README.md" -license = { file = "LICENSE" } +license-files = { paths = ["../LICENSE"] } requires-python = ">=3.7" dependencies = [ @@ -122,9 +121,22 @@ markers = [ "integration" ] +[tool.hatch.version] +path = "src/astro/__init__.py" -[tool.flit.module] -name = "astro" # Or "astro.sql" if you just want this directory, not the entire 'astro'. +[tool.hatch.build.targets.sdist] +exclude = ["tests", "tests_integration", "dev"] + +[tool.hatch.build.targets.wheel] +only-include = ["src"] +sources = ["src"] + +[tool.hatch.metadata.hooks.fancy-pypi-readme] +content-type = "text/markdown" +fragments = [ + { path = "README.md" }, + { path = "docs/CHANGELOG.md" }, +] [tool.mypy] color_output = true