From 84c6a080cd730044452e7c848120a623b76aaa73 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 4 Dec 2024 23:07:20 -0500 Subject: [PATCH] move all hatch things to hatch.toml --- dbt-athena-community/hatch.toml | 56 ++++++++++++++++++++++++ dbt-athena-community/pyproject.toml | 66 ++--------------------------- 2 files changed, 60 insertions(+), 62 deletions(-) create mode 100644 dbt-athena-community/hatch.toml diff --git a/dbt-athena-community/hatch.toml b/dbt-athena-community/hatch.toml new file mode 100644 index 00000000..f1ef474c --- /dev/null +++ b/dbt-athena-community/hatch.toml @@ -0,0 +1,56 @@ +[build.targets.sdist] +include = ["src/dbt"] + +[build.targets.wheel] +packages = ["src/dbt"] + +[envs.default] +# the only build dependency is dbt-athena, which will never be published when running this +# because the versions need to be identical +detached = true +dependencies = [ + "dbt-athena @ {root:uri}/../dbt-athena", + "dbt-tests-adapter~=1.9.2", + "isort~=5.13", + "moto~=5.0.13", + "pre-commit~=3.5", + "pyparsing~=3.1.4", + "pytest~=8.3", + "pytest-cov~=5.0", + "pytest-dotenv~=0.5", + "pytest-xdist~=3.6", +] +[envs.default.scripts] +setup = [ + "pre-commit install", + "cp -n ../dbt-athena/test.env.example test.env", +] +code-quality = "pre-commit run --all-files" +unit-tests = "pytest --cov=dbt --cov-report=html:htmlcov {args:../dbt-athena/tests/unit}" +integration-tests = "python -m pytest -n auto {args:../dbt-athena/tests/functional}" +all-tests = ["unit-tests", "integration-tests"] + +[envs.build] +detached = true +dependencies = [ + "wheel", + "twine", + "check-wheel-contents", +] +[envs.build.scripts] +check-all = [ + "- check-wheel", + "- check-sdist", +] +check-wheel = [ + "check-wheel-contents dist/*.whl --ignore W007,W008", + "find ./dist/dbt_athena_community-*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena-community", + "pip freeze | grep dbt-athena", +] +check-sdist = [ + "twine check dist/*", + "find ./dist/dbt_athena_community-*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", + "pip freeze | grep dbt-athena-community", + "pip freeze | grep dbt-athena", +] diff --git a/dbt-athena-community/pyproject.toml b/dbt-athena-community/pyproject.toml index c0a7e9b8..9363480a 100644 --- a/dbt-athena-community/pyproject.toml +++ b/dbt-athena-community/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + [project] name = "dbt-athena-community" description = "The athena adapter plugin for dbt (data build tool)" @@ -30,69 +34,7 @@ Documentation = "https://docs.getdbt.com" Repository = "https://github.com/dbt-labs/dbt-athena.git#subdirectory=dbt-athena" Issues = "https://github.com/dbt-labs/dbt-athena/issues" -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[tool.hatch.build.targets.sdist] -include = ["src/dbt"] - -[tool.hatch.build.targets.wheel] -packages = ["src/dbt"] - -[tool.hatch.envs.default] -# the only build dependency is dbt-athena, which will never be published when running this -# because the versions need to be identical -detached = true -dependencies = [ - "dbt-athena @ {root:uri}/../dbt-athena", - "dbt-tests-adapter~=1.9.2", - "isort~=5.13", - "moto~=5.0.13", - "pre-commit~=3.5", - "pyparsing~=3.1.4", - "pytest~=8.3", - "pytest-cov~=5.0", - "pytest-dotenv~=0.5", - "pytest-xdist~=3.6", -] -[tool.hatch.envs.default.scripts] -setup = [ - "pre-commit install", - "cp -n ../dbt-athena/test.env.example test.env", -] -code-quality = "pre-commit run --all-files" -unit-tests = "pytest --cov=dbt --cov-report=html:htmlcov {args:../dbt-athena/tests/unit}" -integration-tests = "python -m pytest -n auto {args:../dbt-athena/tests/functional}" -all-tests = ["unit-tests", "integration-tests"] - -[tool.hatch.envs.build] -detached = true -dependencies = [ - "wheel", - "twine", - "check-wheel-contents", -] -[tool.hatch.envs.build.scripts] -check-all = [ - "- check-wheel", - "- check-sdist", -] -check-wheel = [ - "check-wheel-contents dist/*.whl --ignore W007,W008", - "find ./dist/dbt_athena_community-*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", - "pip freeze | grep dbt-athena-community", - "pip freeze | grep dbt-athena", -] -check-sdist = [ - "twine check dist/*", - "find ./dist/dbt_athena_community-*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/", - "pip freeze | grep dbt-athena-community", - "pip freeze | grep dbt-athena", -] - [tool.pytest] -env_files = ["../dbt-athena/test.env"] testpaths = [ "../dbt-athena/tests/unit", "../dbt-athena/tests/functional",