-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
310 lines (263 loc) · 8.45 KB
/
pyproject.toml
File metadata and controls
310 lines (263 loc) · 8.45 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
# This script declares the package/environment/development tool configuration.
#
# Reference:
# https://github.com/pypa/sampleproject/blob/main/pyproject.toml
#
# Useful template repository:
# https://github.com/mCodingLLC/SlapThatLikeButton-TestingStarterProject
#
# Python Packaging User Guide:
# https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
# Python Packaging User Guide Tutorial:
# https://packaging.python.org/en/latest/tutorials/packaging-projects/
#
# Further configurations specific to our chosen build system (setuptools):
# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
# -- Basics ------------------------------------------------------------------
# Build backend
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
# Project metadata
# 'name' is the installation name for a published package. e.g.:
# $ pip install data-tools
#
[project]
name = "datopy"
version = "0.0.1"
description = "Tools for data modeling, ETL, and web scraping"
readme = "README.rst"
requires-python = ">=3.10"
license = {file = "LICENSE"}
keywords = ["pydantic", "beautifulsoup", "modelling", "validation", "etl"]
authors = [
{name="Matthew Bain"},
]
maintainers = [
{name="Matthew Bain"},
]
# For a complete list of classifiers:
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Data Analysts",
"Topic :: Data Management :: DataOps",
"License :: OSI Approved :: MIT License",
# These reqs are not checked by `pip install .`. See `requires-python`.
'Programming Language :: Python :: 3.10',
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only",
"Operating System :: OS Independent",
]
dynamic = ["dependencies", "optional-dependencies"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {dev = { file = ["requirements_dev.txt"] }, optional = { file = ["requirements_optional.txt"] }}
# -- Dependencies ------------------------------------------------------------
# Build dependencies: What a project needs minimally to be run correctly.
# These will be installed by pip when the project is installed with pip.
#
# For details on this vs 'requirements.txt':
# https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/
#
# NOTE: Best practice is to indicate any known lower/upper bounds on versions.
# For repeatable installations, an exhaustive list of requirements is given
# in requirements{_dev}.txt.
# ARK: Replaced with dynamic specification above
# dependencies = [
# "requests>=2.31.0",
# "numpy==1.26.4",
# "pandas>=2.2.2",
# "pydantic>=2.7.0",
# "bs4>=0.0.2",
# "pycurl>=7.45.3",
# ]
#
#
# Extra groups of dependencies:
# For details on dependency specifiers:
# https://packaging.python.org/en/latest/specifications/dependency-specifiers/#extras
# Setuptools details:
# https://setuptools.pypa.io/en/latest/userguide/dependency_management.html
#
# These can be installed using the "extras" syntax, e.g.:
# $ pip install datopy[dev]
#
# ARK: Replaced with dynamic specification above
# [project.optional-dependencies]
# dev = ["mypy>=1.9.0", "pytest>=8.1.1", "flake8>=7.0.0"]
# examples = [
# "jsonschema>=4.21.1",
# "wptools>=0.4.17",
# "cinemagoer>=2023.5.1",
# "spotipy>=2.23.0",
# ]
# -- Additional info ---------------------------------------------------------
# Links
[project.urls]
Homepage = "https://github.com/bainmatt/data-tools"
Issues = "https://github.com/bainmatt/data-tools/issues"
# Executable scripts
# These are installed with pip and execute the specified functions when invoked
#
# Reference:
# https://setuptools.pypa.io/en/latest/userguide/entry_point.html
#
# e.g., `my-script` executes `function` from `my_package.module`:
[project.scripts]
# my-script = "my_package.module:function"
# Data files
# List any data files included in your packages that need to be installed.
# Reference:
# https://setuptools.pypa.io/en/latest/userguide/datafiles.html
[tool.setuptools.package-data]
# package-data = ["*.txt", "*.rst", "*.dat"]
# -- Additional configurations -----------------------------------------------
# --- Package discovery (setuptools-specific) ---
# Reference:
# https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#
[tool.setuptools.packages.find]
where = ["src"]
include = ["datopy"]
# XXX needed?
# --- Whether or not the package is type-hinted ---
# [options.package_data]
# datopy = "py.typed"
# --- Testing configuration ---
# Reference:
# https://docs.pytest.org/en/7.1.x/reference/customize.html
#
# Complete reference:
# https://docs.pytest.org/en/7.1.x/reference/reference.html#configuration-options
[tool.pytest.ini_options]
pythonpath = "src"
# minversion = "6.0"
addopts = "-ra -vv" # -q
testpaths = [
"tests",
]
# Custom test markers (include above test with `@pytest.mark.{marker}`
markers = [
"slow: marks tests as slow (deselect with: '-m \"not slow\"')",
# "benchmark: tests that include benchmarking",
"serial",
]
# --- Coverage reports ---
# Reference:
# https://coverage.readthedocs.io/en/latest/config.html
# [tool.coverage.paths]
# source = [
# "src/datopy/",
# ]
# [tool.coverage.run]
# branch = true
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_also = [
# Don't complain about missing debug-only code
"def __repr__",
"if self\\.debug",
# Don't complain if tests don't hit defensive assertion code
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run
"@(abc\\.)?abstractmethod",
]
ignore_errors = true
show_missing = true
# Don't report on files that have no executable code (e.g., __init__.py)
skip_empty = true
# --- Typing configuration ---
# mypy .toml docs:
# https://mypy.readthedocs.io/en/stable/config_file.html
#
# mypy command line docs:
# https://mypy.readthedocs.io/en/stable/command_line.#html
#
# Also useful:
# https://justincaustin.com/blog/mypy-tips-and-tricks/
#
# Dealing with generics:
# https://mypy.readthedocs.io/en/stable/generics.html
#
# To run mypy on pkg in src (while respecting every configuration here):
# (root_dir) $ mypy .
# To run mypy on subpkg/module in src:
# (root_dir) $ mypy {relative_path}/{module}.py
#
[tool.mypy]
mypy_path = "src"
# check_untyped_defs = true
ignore_missing_imports = true
no_implicit_reexport = true
show_error_codes = true
show_error_context = true
# Main typing configurations
no_implicit_optional = true
strict_optional = true
strict_equality = true
disallow_any_generics = true # strict
warn_return_any = true # strict
warn_redundant_casts = true
warn_unreachable = true # strict
warn_unused_configs = true
# Pydantic integration
# https://docs.pydantic.dev/latest/integrations/mypy/
plugins = [
"pydantic.mypy"
]
# Do not type-check the specified subpkgs/modules
# Inline silencing of specific errors:
# https://mypy.readthedocs.io/en/stable/error_codes.html
[[tool.mypy.overrides]]
module = [
# "datopy.models.*",
"datopy.archive.*",
"datopy._examples",
"datopy._functions_to_test",
"datopy._media_scrape",
]
ignore_errors = true
# [tool.numpydoc_validation]
# checks = [
# "all", # report on all checks, except the below
# "EX01",
# "SA01",
# "ES01",
# ]
# exclude = [ # don't report on objects that match any of these regex
# '\.undocumented_method$',
# '\.__repr__$',
# ]
# override_SS05 = [ # override SS05 to allow docstrings starting with these words
# '^Process ',
# '^Assess ',
# '^Access ',
# ]
# -- Build and installation --------------------------------------------------
#
# Development mode (setuptools):
# https://setuptools.pypa.io/en/latest/userguide/development_mode.html
#
# Building and distributing packages with setuptools:
# https://setuptools.pypa.io/en/latest/setuptools.html
#
# Build system support (setuptools):
# https://setuptools.pypa.io/en/latest/build_meta.html
#
# The packaging flow (Python Packaging User Guide):
# https://packaging.python.org/en/latest/flow/
# To perform editable installation (with environment activated)
# (such that changes in the Python source code can immediately take place
# without requiring a new installation):
#
# $ pip install --editable .
#
# To uninstall:
#
# $ pip uninstall datopy
#