forked from dbt-labs/dbt-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
186 lines (165 loc) · 4.79 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
[project]
name = "dbt-common"
dynamic = ["version"]
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]" },
]
maintainers = [
{ name = "dbt Labs", email = "[email protected]" },
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"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 :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"agate>=1.7.0,<1.10",
"colorama>=0.3.9,<0.5",
"deepdiff>=7.0,<8.0",
"isodate>=0.6,<0.7",
"jsonschema>=4.0,<5.0",
"Jinja2>=3.1.3,<4",
"mashumaro[msgpack]>=3.9,<4.0",
"pathspec>=0.9,<0.13",
"protobuf>=4.0.0,<5.0.0",
"python-dateutil>=2.0,<3.0",
"requests<3.0.0", # needs to match dbt-core
"typing-extensions>=4.4,<5.0",
]
[project.optional-dependencies]
lint = [
"black>=23.3,<24.0",
"flake8",
"flake8-pyproject",
"flake8-docstrings",
"mypy>=1.3,<2.0",
"pytest>=7.3,<8.0", # needed for linting tests
"types-Jinja2>=2.11,<3.0",
"types-jsonschema>=4.17,<5.0",
"types-protobuf>=4.24,<5.0",
"types-python-dateutil>=2.8,<3.0",
"types-PyYAML>=6.0,<7.0",
"types-requests"
]
test = [
"pytest>=7.3,<8.0",
"pytest-mock",
"pytest-xdist>=3.2,<4.0",
"pytest-cov>=4.1,<5.0",
"hypothesis>=6.87,<7.0",
]
build = [
"wheel",
"twine",
"check-wheel-contents",
]
[project.urls]
Homepage = "https://github.com/dbt-labs/dbt-common"
Repository = "https://github.com/dbt-labs/dbt-common.git"
Issues = "https://github.com/dbt-labs/dbt-common/issues"
Changelog = "https://github.com/dbt-labs/dbt-common/blob/main/CHANGELOG.md"
[tool.hatch.version]
path = "dbt_common/__about__.py"
### Default env & scripts
[tool.hatch.envs.default]
description = "Default environment with dependencies for running dbt-common"
features = ["lint", "test"]
[tool.hatch.envs.default.scripts]
proto = "protoc -I=./dbt_common/events --python_out=./dbt_common/events ./dbt_common/events/types.proto"
### Test settings, envs & scripts
[tool.hatch.envs.test]
description = "Env for running development commands for testing"
features = ["test"]
[tool.hatch.envs.test.scripts]
unit = "python -m pytest --cov=dbt_common --cov-report=xml {args:tests/unit}"
### Linting settings, envs & scripts
[tool.hatch.envs.lint]
type = "virtual"
description = "Env for running development commands for linting"
features = ["lint"]
[tool.hatch.envs.lint.scripts]
all = [
"- black",
"- flake8",
"- mypy",
]
black = "python -m black ."
flake8 = "python -m flake8 ."
mypy = "python -m mypy ."
[tool.black]
extend-exclude = "dbt_common/events/types_pb2.py"
line-length = 99
target-version = ['py38']
[tool.flake8]
max-line-length = 99
select = ["E", "W", "F"]
ignore = ["E203", "E501", "E741", "W503", "W504"]
exclude = [
"dbt_common/events/types_pb2.py",
"venv",
"env*"
]
per-file-ignores = ["*/__init__.py: F401"]
docstring-convention = "google"
[tool.mypy]
mypy_path = "third-party-stubs/"
namespace_packages = true
warn_unused_configs = true
show_error_codes = true
disable_error_code = "attr-defined" # TODO: revisit once other mypy errors resolved
disallow_untyped_defs = false # TODO: add type annotations everywhere
warn_redundant_casts = true
exclude = [
"dbt_common/events/types_pb2.py",
"env*",
"third-party-stubs/*",
]
### Build settings, envs & scripts
[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",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["dbt_common"]
[tool.hatch.envs.build]
description = "Env for running development commands for linting"
features = ["build"]
[tool.hatch.envs.build.scripts]
check-all = [
"- check-wheel",
"- check-sdist",
]
check-wheel = [
"twine check dist/*",
"find ./dist/dbt_common-*.whl -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/",
"pip freeze | grep dbt-common",
]
check-sdist = [
"check-wheel-contents dist/*.whl --ignore W007,W008",
"find ./dist/dbt_common-*.gz -maxdepth 1 -type f | xargs python -m pip install --force-reinstall --find-links=dist/",
"pip freeze | grep dbt-common",
]