generated from dbt-labs/dbt-oss-template
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a6efee
commit 0c380be
Showing
2 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DEFAULT_GOAL:=help | ||
|
||
.PHONY: dev_req | ||
dev_req: ## Installs dbt-* packages in develop mode along with only development dependencies. | ||
@\ | ||
pip install -r dev-requirements.txt | ||
|
||
.PHONY: dev | ||
dev: dev_req ## Installs dbt-* packages in develop mode along with development dependencies and pre-commit. | ||
@\ | ||
pre-commit install | ||
|
||
.PHONY: proto_types | ||
proto_types: ## generates google protobuf python file from types.proto | ||
protoc -I=./dbt/common/events --python_out=./dbt/common/events ./dbt/common/events/types.proto | ||
|
||
.PHONY: help | ||
help: ## Show this help message. | ||
@echo 'usage: make [target]' | ||
@echo | ||
@echo 'targets:' | ||
@grep -E '^[8+a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
[project] | ||
name = "dbt-common" | ||
version = "0.5.0a2" | ||
description = "The shared common utilities that dbt-core and adapter implementations use" | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
license = "Apache-2.0" | ||
keywords = [] | ||
authors = [ | ||
{ name = "dbt Labs", email = "[email protected]" }, | ||
] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"agate~=1.7.0", | ||
"jsonschema~=4.0", | ||
"Jinja2~=3.0", | ||
"mashumaro[msgpack]~=3.9", | ||
"python-dateutil~=2.0", | ||
"typing-extensions~=4.4", | ||
] | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
"/.github", | ||
"/.changes", | ||
".changie.yaml", | ||
".gitignore", | ||
".pre-commit-config.yaml", | ||
"CONTRIBUTING.md", | ||
"MAKEFILE", | ||
"/tests", | ||
] | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["dbt_common"] | ||
|
||
[tool.hatch.envs.dev-env.scripts] | ||
all = ["pre-commit run --all-files"] | ||
|
||
[tool.hatch.envs.dev-env] | ||
description = "Env for running development commands like pytest / pre-commit" | ||
dependencies = [ | ||
"pytest~=7.3", | ||
"pytest-xdist~=3.2", | ||
"httpx~=0.24", | ||
"hypothesis~=6.87", | ||
"pre-commit~=3.2", | ||
"isort~=5.12", | ||
"black~=23.3", | ||
"ruff==0.0.260", | ||
"mypy~=1.3", | ||
"pytest~=7.3", | ||
"types-Jinja2~=2.11", | ||
"types-jsonschema~=4.17", | ||
"types-python-dateutil~=2.8", | ||
"types-PyYAML~=6.0", | ||
] | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
select = [ | ||
"E", # Pycodestyle | ||
"F", # Pyflakes | ||
"W", # Whitespace | ||
"D", # Pydocs | ||
] | ||
ignore = [ | ||
# Missing docstring in public module -- often docs handled within classes | ||
"D100", | ||
# Missing docstring in public package -- often docs handled within files not __init__.py | ||
"D104" | ||
] | ||
# Let ruff autofix these errors. | ||
# F401 - Unused imports. | ||
fixable = ["F401"] | ||
|
||
[tool.ruff.pydocstyle] | ||
convention = "google" | ||
|
||
[tool.mypy] | ||
mypy_path = "third-party-stubs/" | ||
namespace_packages = true | ||
warn_unused_configs = true | ||
disallow_untyped_defs = true | ||
warn_redundant_casts = true | ||
|
||
# Don't run the extensive mypy checks on custom stubs | ||
[[tool.mypy.overrides]] | ||
module = ["logbook.*"] | ||
disallow_untyped_defs = false | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.black] | ||
line-length = 120 |