-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
227 lines (201 loc) · 6.49 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
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=66",
"setuptools_scm[toml]>=3.5.0",
"wheel",
]
[project]
# This should be the *installed* package name e.g. catalystcoop.pudl not pudl
name = "catalystcoop.cheshire"
description = "Replace this text with a one line description of the package."
readme = {file = "README.rst", content-type = "text/x-rst"}
authors = [
{name = "Catalyst Cooperative", email = "pudl@catalyst.coop"}
]
requires-python = ">=3.10,<3.13"
dynamic = ["version"]
license = {file = "LICENSE.txt"}
dependencies = [
"pandas[parquet,excel,fss,gcp,compression]>=2,<3",
"pydantic[email]>=2,<3",
"sqlalchemy>=2,<3",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = [
"template",
"testing",
"linting",
"github actions",
"continuous integration",
"continuous delivery",
]
[project.scripts]
# "script_name = dotted.module.path.to:main_script_function",
winston = "cheshire.cli:main"
[project.urls]
# "Homepage" = ""
"Source" = "https://github.com/catalyst-cooperative/cheshire"
"Documentation" = "https://catalystcoop-cheshire.readthedocs.io"
"Issue Tracker" = "https://github.com/catalyst-cooperative/cheshire/issues"
[project.optional-dependencies]
dev = [
"build>=1,<2", # The setuptools package builder
"tox>=4,<5", # Python test environment manager
"twine>=4,<7", # Used to make releases to PyPI
]
docs = [
"doc8>=1,<2", # Ensures clean documentation formatting
"furo>=2022.4.7",
"sphinx>=6,<9", # The default Python documentation engine
"sphinx-autoapi>=2,<4", # Generates documentation from docstrings
"sphinx-issues>=1.2,<6", # Allows references to GitHub issues
]
tests = [
"coverage>=7,<8", # Lets us track what code is being tested
"exceptiongroup>=1,<2",
"jupyter", # For integration testing Jupyter notebooks
"mypy>=1.0,<1.15", # Static type checking
"nbconvert>=7,<8",
"nbformat>=5,<6",
"pre-commit>=4,<5", # Allow us to run pre-commit hooks in testing
"pydocstyle>=6,<7", # Style guidelines for Python documentation
"pytest-console-scripts>=1.1,<2", # Allow automatic testing of scripts
"pytest-cov>=4,<7", # Pytest plugin for working with coverage
"pytest>=7,<9", # Our testing framework
"ruff>=0.6", # A very fast python linter & autofixer
"tox>=4,<5", # Python test environment manager
]
types = [
"types-setuptools",
]
[tool.setuptools_scm]
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"]
[tool.doc8]
max-line-length = 88
ignore-path = ["docs/_build"]
[tool.pytest.ini_options]
testpaths = "./"
filterwarnings = [
# Examples of how to filter out pytest warnings from dependencies
# "ignore:distutils Version classes are deprecated:DeprecationWarning",
# "ignore:Deprecated call to `pkg_resources.declare_namespace:DeprecationWarning",
# "ignore:Deprecated call to.*declare_namespace:DeprecationWarning:pkg_resources",
]
addopts = "--verbose --pdbcls=IPython.terminal.debugger:TerminalPdb"
log_format = "%(asctime)s [%(levelname)8s] %(name)s:%(lineno)s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
log_cli = "true"
log_cli_level = "DEBUG"
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
[tool.ruff]
# Configurations that apply to both the `format` and `lint` subcommands.
target-version = "py312"
line-length = 88
indent-width = 4
[tool.ruff.format]
# Configuration specfic to the `format` subcommand.
# We use black compatible formatting.
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"C", # Limit cyclomatic complexity using mccabe
"C4", # flake8-comprehensions
"D", # pydocstyle errors
"E", # pycodestyle errors
"EXE", # executable file issues
"F", # pyflakes
"I", # isort
"ICN", # flake8 import conventions
"N", # pep8-naming
"NPY", # NumPy specific checks
"PD", # pandas checks
"PGH", # pygrep-hooks
"PIE", # flake8-pie miscellaneous linting
"PTH", # use pathlib
"Q", # flake8-quotes
"RET", # check return values
"RSE", # unnecessary parenthises on raised exceptions
"S", # flake8-bandit
"SIM", # flake8-simplify
"UP", # pyupgrade (use modern python syntax)
"W", # pycodestyle warnings
# "ARG", # unused arguments
# "ERA", # eradicate: find commented out code
# "PL", # pylint
# "PT", # pytest style
# "T", # print statements found
]
ignore = [
"D401", # Require imperative mood in docstrings.
"D417",
"E501", # Overlong lines.
"PD010", # Use of df.stack()
"PD013", # Use of df.unstack()
"PD015", # Use of pd.merge() rather than df.merge()
"PD901", # df as variable name
"RET504", # Ignore unnecessary assignment before return
"S101", # Use of assert
]
extend-select = ["NPY201"] # preview rule to easy migration to Numpy 2.0
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports
"tests/*" = ["D"]
[tool.ruff.lint.pep8-naming]
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
classmethod-decorators = ["pydantic.validator", "pydantic.root_validator"]
[tool.ruff.lint.isort]
known-first-party = ["pudl"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
[tool.coverage.report]
precision = 2
sort = "miss"
skip_empty = true
fail_under = 90
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# 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__.:",
# Stuff that's not expected to run normally...
"logger.debug",
]