-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpyproject.toml
234 lines (207 loc) · 6 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
[build-system]
requires = ["setuptools>=68.2.2"]
build-backend = "setuptools.build_meta"
[project]
name = "xocto"
version = "7.0.0"
requires-python = ">=3.9"
description = "Kraken Technologies Python service utilities"
readme = "README.md"
authors = [
{name = "Kraken Technologies", email = "[email protected]"},
]
maintainers = [
{name = "Kraken Technologies", email = "[email protected]"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development :: Build Tools",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
license = {text = "MIT"}
dependencies = [
"ddtrace>=1.9.0",
"duckdb>=0.9.0",
"django>=4.0",
"openpyxl>=3.1.0",
"pact-python>=1.6.0",
"pandas>=1.5.3",
"pyarrow>=11.0.0",
"python-dateutil>=2.8.2",
"python-magic>=0.4.27",
"pytz",
"structlog>=20.2.0",
"xlrd>=2.0.1",
]
[project.optional-dependencies]
dev = [
"boto3==1.26.53",
"botocore==1.29.53",
"hypothesis==6.62.1",
"moto[s3,sqs]==4.1",
"mypy-boto3-s3==1.34.120",
"mypy==1.10.0",
"numpy==1.22.2",
"pre-commit>=3.7.1",
"psycopg2>=2.8.4",
"pyarrow-stubs==10.0.1.6",
"pytest-django==4.8.0",
"pytest-mock==3.12.0",
"pytest==8.0.2",
"ruff==0.4.9",
"time-machine==2.14.1",
"twine==4.0.2",
"types-openpyxl==3.0.4.5",
"types-python-dateutil==2.8.19.20240106",
"types-pytz==2024.1.0.20240203",
"types-requests==2.28.11.8",
"wheel==0.38.4",
]
docs = [
"Sphinx==7.2.6",
"myst-parser==2.0.0",
"sphinxcontrib-serializinghtml==1.1.10",
"sphinx-rtd-theme==2.0.0",
]
[project.urls]
changelog = "https://github.com/octoenergy/xocto/blob/main/CHANGELOG.md"
documentation = "https://xocto.readthedocs.io"
issues = "https://github.com/octoenergy/xocto/issues"
[tool.setuptools.packages.find]
include = ["xocto*"]
namespaces = false
[tool.setuptools.package-data]
"xocto" = ["py.typed"]
# Mypy
# ----
[tool.mypy]
# Specify which files to check.
files = [
"xocto",
"tests",
"*.py",
]
# Output.
show_error_codes = true
# Strict mode; enables the following flags:
# --check-untyped-defs
# --disallow-any-generics,
# --disallow-incomplete-defs
# --disallow-subclassing-any
# --disallow-untyped-calls
# --disallow-untyped-decorators,
# --disallow-untyped-defs,
# --no-implicit-reexport
# --strict-concatenate
# --strict-equality
# --warn-redundant-casts
# --warn-return-any
# --warn-unused-configs
# --warn-unused-ignores
strict = true
# These flags enabled by `strict` are ones we're overriding.
disallow_subclassing_any = false
warn_return_any = false
# Enable the following optional checks.
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
"unused-awaitable",
]
# Warnings.
warn_unreachable = true
# Don't force test functions to include types.
[[tool.mypy.overrides]]
module = [
"tests.*",
]
disallow_untyped_defs = false
check_untyped_defs = false
# Ignore errors from packages that don't have type annotations.
[[tool.mypy.overrides]]
module = [
"boto3.*",
"botocore.*",
"django.*",
"moto.*",
"pact.*",
"pandas.*",
"setuptools.*",
"xlrd.*",
"zoneinfo.*",
]
ignore_missing_imports = true
# Ruff
# ----
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
]
ignore = [
"E501", # line too long
]
[tool.ruff.lint.per-file-ignores]
# Allow unused imports in __init__ files as these are convenience imports
"**/__init__.py" = [ "F401" ]
[tool.ruff.lint.isort]
lines-after-imports = 2
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"project",
"local-folder",
]
[tool.ruff.lint.isort.sections]
"project" = [
"xocto",
"tests",
]
# Pytest
# ------
[tool.pytest.ini_options]
# Convert some warning types into errors but ignore some others that we
# can't/won't fix right now.
#
# Note:
# - Each line is a colon-separated string.
# - The first part is what to do with the warning - error or ignore.
# - The second part is a regex that must match the start of the warning message.
# - The third part is the warning class name.
# - The fourth part is a regex that must match the module triggering the error.
# - The order matters. These rules get applied with the bottom rule first.
# Hence the rules ignoring deprecation warnings must by below the rule that converts
# DeprecationWarnings into errors.
filterwarnings = [
"error::RuntimeWarning",
"error::DeprecationWarning",
"ignore:defusedxml.lxml:DeprecationWarning:zeep",
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3:DeprecationWarning:(graphene|singledispatch)",
# https://github.com/ktosiek/pytest-freezegun/issues/35
"ignore:distutils Version classes are deprecated:DeprecationWarning:pytest_freezegun",
]
DJANGO_SETTINGS_MODULE = "tests.settings"
# Test modules must have be named this way.
python_files = "test_*.py"
# Default options when pytest is run:
#
# --verbose -> Show names of tests being run.
# --tb=short -> Use short tracebacks.
# https://docs.pytest.org/en/stable/usage.html#modifying-python-traceback-printing
# --nomigrations -> Disable Django's migrations and create the database by inspecting models instead.
# https://pytest-django.readthedocs.io/en/latest/database.html#nomigrations-disable-django-migrations
# --reuse-db -> Don't remove test database after each test run so it can be re-used next time.
# https://pytest-django.readthedocs.io/en/latest/database.html#reuse-db-reuse-the-testing-database-between-test-runs
# --color=auto -> Detect whether to print colored output.
# --capture=fd -> Capture all output written to the STDOUT and STDERR file descriptors.
# https://docs.pytest.org/en/stable/capture.html
#
addopts = "--tb=short --verbose --nomigrations --reuse-db --color=auto --capture=fd"