Skip to content

Commit

Permalink
move all hatch things to hatch.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mikealfare committed Dec 5, 2024
1 parent 2201324 commit 84c6a08
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 62 deletions.
56 changes: 56 additions & 0 deletions dbt-athena-community/hatch.toml
Original file line number Diff line number Diff line change
@@ -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",
]
66 changes: 4 additions & 62 deletions dbt-athena-community/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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)"
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 84c6a08

Please sign in to comment.