-
Notifications
You must be signed in to change notification settings - Fork 17
/
pyproject.toml
253 lines (229 loc) · 6.15 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# Default tool config file. See also setup.cfg for tools that don't yet
# support pyproject.toml.
[build-system]
requires = ['setuptools>=61', 'setuptools_scm[toml]']
build-backend = 'setuptools.build_meta'
[project]
name = 'baseframe'
description = 'Baseframe for Hasgeek projects'
readme = 'README.rst'
requires-python = '>=3.9'
keywords = ['baseframe', 'flask', 'framework', 'web']
license = { file = 'LICENSE.txt' }
dynamic = ['version']
maintainers = [{ name = 'Hasgeek', email = '[email protected]' }]
authors = [{ name = 'Kiran Jonnalagadda' }]
urls = { repository = 'https://github.com/hasgeek/baseframe' }
classifiers = [
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Development Status :: 5 - Production/Stable',
'Topic :: Software Development :: Libraries',
]
dependencies = [
'bleach',
'blinker',
'coaster',
'cssmin',
'dnspython',
'emoji>=1.0.0',
'Flask-Assets',
'Flask-Babel>=3.0.0',
'Flask-Caching',
'Flask-WTF>=0.14',
'Flask>=2.2',
'furl',
'grapheme>=0.6.0',
'html5lib>=1.0.1',
'markupsafe',
'mxsniff',
'pycountry',
'pyIsEmail',
'python-dateutil',
'pytz',
'redis',
'requests',
'rq',
'semantic_version',
'sentry-sdk',
'statsd',
'typing_extensions',
'werkzeug',
'WTForms-SQLAlchemy',
'WTForms>=3.1',
]
[tool.setuptools.dynamic]
version = { attr = 'baseframe._version.__version__' }
[tool.setuptools.packages.find]
where = ['src']
[tool.black]
line-length = 88
target-version = ['py39']
skip-string-normalization = true
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| __pycache__
| buck-out
| build
| dist
| node_modules
| src/baseframe/static
)/
'''
[tool.isort]
# Some isort functionality is replicated in ruff, which should have matching config
profile = 'black'
multi_line_output = 3
include_trailing_comma = true
line_length = 88
order_by_type = true
use_parentheses = true
combine_as_imports = true
split_on_trailing_comma = false
extra_standard_library = ['typing_extensions']
known_repo = ['baseframe']
known_first_party = ['coaster']
default_section = 'THIRDPARTY'
sections = [
'FUTURE',
'STDLIB',
'THIRDPARTY',
'FIRSTPARTY',
'REPO',
'LOCALFOLDER',
]
[tool.mypy]
files = '**/*.py'
exclude = 'node_modules'
ignore_missing_imports = true
show_error_codes = true
warn_unreachable = true
warn_unused_ignores = true
warn_redundant_casts = true
check_untyped_defs = true
[tool.pytest.ini_options]
pythonpath = 'src'
minversion = '6.0'
addopts = '--doctest-modules --ignore setup.py --cov-report=term-missing'
doctest_optionflags = ['ALLOW_UNICODE', 'ALLOW_BYTES']
[tool.pylint.master]
# max-parents = 10
init-hook = '''
import os, astroid.bases, pathlib
# Tell Pylint where to find packages from within tests
for path in pathlib.Path.cwd().parents:
if (path / 'pyproject.toml').is_file():
sys.path.insert(0, str(path / 'src'))
'''
[tool.pylint.message_control]
max-line-length = 88
disable = [
'cyclic-import', # We have tail imports all over
'fixme', # Our workflow is to tag for future fixes
'invalid-name', # Flake8 covers our naming convention requirements
'line-too-long', # Let Black/Ruff handle this
'missing-class-docstring', # Backlog
'missing-function-docstring', # Backlog
'no-member', # Pylint doesn't understand mixins referring to main class members
'redefined-builtin', # Covered by Flake8 already
'too-few-public-methods', # Data classes and validator classes have few methods
'too-many-arguments',
'too-many-branches',
'too-many-locals',
'too-many-instance-attributes', # Some instances are just bags of attributes
'too-many-lines',
'too-many-nested-blocks',
'too-many-positional-arguments',
'too-many-return-statements',
'too-many-statements',
'unused-argument', # Arguments required for spec compatibility aren't always used
'wrong-import-position', # Imports after code are sometimes required
'wrong-import-order', # Let black and isort handle this
]
[tool.bandit]
exclude_dirs = ['node_modules']
[tool.bandit.assert_used]
skips = ['*/*_test.py', '*/test_*.py']
[tool.ruff]
# 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",
]
# Same as Black.
line-length = 88
# Target Python 3.9
target-version = "py39"
[tool.ruff.format]
docstring-code-format = true
quote-style = "preserve"
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F"]
ignore = ["E402", "E501"]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["E402"] # Allow non-top-level imports
"tests/**.py" = [
"S101", # Allow assert
"ANN001", # Args don't need types (usually fixtures)
"N802", # Fixture returning a class may be named per class name convention
"N803", # Args don't require naming convention (fixture could be a class)
]
[tool.ruff.lint.isort]
# These config options should match isort config above under [tool.isort]
combine-as-imports = true
extra-standard-library = ['typing_extensions']
split-on-trailing-comma = false
relative-imports-order = 'furthest-to-closest'
known-first-party = ['coaster', 'flask_lastuser']
section-order = [
'future',
'standard-library',
'third-party',
'first-party',
'repo',
'local-folder',
]
[tool.ruff.lint.isort.sections]
repo = ['baseframe']
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true