Skip to content

Commit

Permalink
initial Makefile and pyproject.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Jan 4, 2024
1 parent 5a6efee commit e5f7b08
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Makefile
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}'

109 changes: 109 additions & 0 deletions pyproject.toml
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"]

[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

0 comments on commit e5f7b08

Please sign in to comment.