-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
233 lines (203 loc) · 5.78 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "TypeDAL"
dynamic = ["version"]
description = 'Typing support for PyDAL'
readme = "README.md"
requires-python = ">=3.10"
license = "MIT"
keywords = []
authors = [
{ name = "Robin van der Noord", email = "contact@trialandsuccess.nl" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"pydal", # core
"dill", # caching
"configuraptor >= 1.26.2", # config
"Configurable-JSON", # json dumping
"python-slugify",
"legacy-cgi; python_version >= '3.13'"
]
[project.optional-dependencies]
py4web = [
"py4web",
]
migrations = [
"typer",
"tabulate",
"pydal2sql>=1.2.0",
"edwh-migrate>=0.8.0",
"questionary",
"tomlkit",
]
all = [
"py4web",
"typer",
"tabulate",
"pydal2sql[all]>=1.2.0",
"edwh-migrate[full]>=0.8.0",
"questionary",
"tomlkit",
]
dev = [
# build:
"hatch",
# test:
"su6[all]>=1.9.0",
"python-semantic-release < 8",
"pytest-mypy-testing",
"contextlib-chdir",
"testcontainers",
# depends on ->
"requests<2.32",
# mypy:
"types-tabulate",
"types-PyYAML",
"types-requests",
# docs:
'mkdocs',
'mkdocs-dracula-theme',
]
[template.plugins.default]
src-layout = true
[tool.setuptools.package-data]
"typedal" = ["py.typed"]
[project.scripts]
typedal = "typedal.cli:app"
[project.urls]
Documentation = "https://typedal.readthedocs.io/"
Issues = "https://github.com/trialandsuccess/TypeDAL/issues"
Source = "https://github.com/trialandsuccess/TypeDAL"
[tool.hatch.version]
path = "src/typedal/__about__.py"
[tool.semantic_release]
branch = "master"
version_variable = "src/typedal/__about__.py:__version__"
change_log = "CHANGELOG.md"
upload_to_repository = false
upload_to_release = false
build_command = "hatch build"
### required in every su6 pyproject: ###
[tool.su6]
directory = "src"
stop-after-first-failure = true
include = []
exclude = []
coverage = 100
badge = true
[tool.su6.default-flags]
mypy = "--disable-error-code misc"
[tool.black]
target-version = ["py310"]
line-length = 120
# 'extend-exclude' excludes files or directories in addition to the defaults
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
(
^.*\.bak\/.+ # ignore every .bak directory
^.*venv.+\/.+ # ignore every venv directory
venv.+|.+\.bak # idk why it suddenly works, let's not touch it
)
'''
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"except ImportError as e:",
"except ImportError:",
]
[tool.mypy]
python_version = "3.11"
# `some: int = None` looks nicer than `some: int | None = None` and pycharm still understands it
no_implicit_optional = false # I guess 'strict_optional' should be true, but disable this one because it's double!
# same as above (thrown if no_implicit_optional = False)
# ACTUALLY: not the same! Setting strict_optional = false may miss some type errors like
# 'Item "None" of "Optional" has no attribute "lower"'
# 'strict_optional' complains more for class properties and 'no_implicit_optional' for function arguments
# strict_optional = false
# 3rd party packages may not be typed, that's not my fault!
ignore_missing_imports = true
# kinda hypocritical to disable Optional and still enable strict, but I do agree with some other strict rules.
strict = true
# fixes defs with clear return var (doesn't seem to work for __init__ which is the most obvious case)
# check_untyped_defs = True
# disable_error_code = "misc" # skip misc makes mypy tests fail!
exclude = ["venv", ".bak"]
[tool.ruff]
target-version = "py310"
line-length = 120
extend-exclude = ["*.bak/", "venv*/"]
[tool.ruff.lint]
select = [
"F", # pyflake error
"E", # pycodestyle error
"W", # pycodestyle warning
"Q", # quotes
"A", # builtins
# "C4", # comprehensions - NO: doesn't allow dict()
# "RET", # return - NO: annoying
"SIM", # simplify
"ARG", # unused arguments
# "COM", # comma's - NO: annoying
# "PTH", # use pathlib - NO: annoying
"RUF", # ruff rules
]
unfixable = [
# Don't touch unused imports
"F401",
]
extend-ignore = [
# db.field == None should NOT be fixed to db.field is None
"E711",
]
ignore = [
"RUF013" # implicit optional
]
[tool.bandit]
# bandit -c pyproject.toml -r .
exclude_dirs = [".bak", "venv"]
skips = [
"B108" # hard coded /tmp/... files are fine for me tbh
]
[tool.isort]
profile = "black"
extend_skip_glob = ["*.bak/*"]
[tool.pydocstyle]
convention = "google"
match-dir = '(?!venv)[^\.].*'
add_select = [
"D213", # = Multi-line docstring summary should start at the second line
"D416", # = Google-style section name checks.
"D417", # = Missing argument descriptions in the docstring
]
add_ignore = [
"D200", # = One-line docstring should fit on one line with quotes
"D212", # = Multi-line docstring summary should start at the first line
]
### and if it's a project and NOT a package, add this to make it not look for anything buildable: ###
# make this a meta package: not a library but simply allow me to run `pip install .[dev]`
#[build-system]
#build-backend = "setuptools.build_meta"
#requires = ["setuptools"]
#
#[tool.setuptools.packages.find]
## look nowhere for any code to 'build' since this is just used to manage (dev) dependencies
#where = []
[tool.pytest.ini_options]
pythonpath = [
"src",
]
[tool.typedal]