-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
196 lines (165 loc) · 4.81 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
187
188
189
190
191
192
193
194
195
196
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "sample-project-python"
version = "0.3.1"
description = "Sample Python Project"
license = "MIT"
authors = [{name = "Dillon Stadther"}, ]
readme = "README.md"
requires-python = ">=3.9"
dependencies = []
[project.urls]
Documentation = "https://dlstadther.github.io/sample-project-python"
Repository = "https://github.com/dlstadther/sample-project-python"
[project.optional-dependencies]
df = [
"pandas >= 2.0.0",
]
[dependency-groups]
dev = [
"mkdocs >=1.6.0,<2",
"mkdocs-material >=9.4.5,<10",
"mkdocstrings[python] >=0.25.2,<1",
"mypy >=1.11.1,<2",
"nox >=2024.4.15,<2025",
"pre-commit >=3.8.0,<4",
"pytest >=8.3.2,<9",
"pytest-cov >=5.0.0,<6",
"ruff >=0.6.2,<1",
"sqlfluff >=3.1.1,<4",
]
[tool.hatch.build]
packages = ["src/sample"]
##########
# Coverage
##########
[tool.coverage.run]
omit = [".*", "*/site-packages/*"]
src = ["src"]
[tool.coverage.report]
fail_under = 70
show_missing = true
######
# Mypy
######
[tool.mypy]
# we do not want mypy to report errors from followed imports because we are only focused on new code
# we will have some clean-up to do before removing this arg
follow_imports = "silent"
ignore_missing_imports = true
######
# Ruff
######
[tool.ruff]
line-length = 160
# auto-apply changes
#fix = true
#exit-non-zero-on-fix = true
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
]
# check out their meaning here
# https://flake8.pycqa.org/en/latest/user/error-codes.html
# https://www.flake8rules.com/
ignore = [
"E402", # Module level import not at top of file
"E501", # Line too long (82 > 79 characters)
# prefer list(), dict(), etc.
"C408", # Rewrite as a literal
]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
########
# Pytest
########
[tool.pytest.ini_options]
addopts = "--cov=src --strict-markers"
markers = [
"df: marks tests as requiring the \"df\" extra install (deselect with '-m \"not df\"')",
]
pythonpath = [
"src"
]
##########
# Sqlfluff
##########
[tool.sqlfluff.core]
# Supported dialects https://docs.sqlfluff.com/en/stable/dialects.html
dialect = "postgres"
templater = "jinja"
sql_file_exts = ".sql,.sql.j2,.dml,.ddl"
# Comma separated list of rules to exclude, or None
# See https://docs.sqlfluff.com/en/stable/configuration.html#enabling-and-disabling-rules
# AM04 (ambiguous.column_count) and ST06 (structure.column_order) are
# two of the more controversial rules included to illustrate usage.
#exclude_rules =
# The standard max_line_length is 80 in line with the convention of
# other tools and several style guides. Many projects however prefer
# something a little longer.
# Set to zero or negative to disable checks.
max_line_length = 120
[tool.sqlfluff.indentation]
indented_ctes = true
indented_joins = false
indented_using_on = true
template_blocks_indent = false
[tool.sqlfluff.templater]
unwrap_wrapped_queries = true
# The default configuration for aliasing rules is "consistent"
# which will auto-detect the setting from the rest of the file. This
# is less desirable in a new project and you may find this (slightly
# more strict) setting more useful.
[tool.sqlfluff.rules.aliasing.table]
aliasing = "explicit"
[tool.sqlfluff.rules.aliasing.column]
aliasing = "explicit"
[tool.sqlfluff.rules.aliasing.length]
min_alias_length = 3
# The default configuration for capitalisation rules is "consistent"
# which will auto-detect the setting from the rest of the file. This
# is less desirable in a new project and you may find this (slightly
# more strict) setting more useful.
# Typically we find users rely on syntax highlighting rather than
# capitalisation to distinguish between keywords and identifiers.
# Clearly, if your organisation has already settled on uppercase
# formatting for any of these syntax elements then set them to "upper".
# See https://stackoverflow.com/questions/608196/why-should-i-capitalize-my-sql-keywords-is-there-a-good-reason
[tool.sqlfluff.rules.capitalisation.keywords]
capitalisation_policy = "lower"
[tool.sqlfluff.rules.capitalisation.identifiers]
capitalisation_policy = "lower"
[tool.sqlfluff.rules.capitalisation.functions]
extended_capitalisation_policy = "lower"
[tool.sqlfluff.rules.capitalisation.literals]
capitalisation_policy = "lower"
[tool.sqlfluff.rules.capitalisation.types]
extended_capitalisation_policy = "lower"