generated from rmi-electricity/cheshire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
214 lines (202 loc) · 6.61 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
[build-system]
requires = ["setuptools>=60", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "rmi.etoolbox"
description = "A set of tools and functions we use across projects."
license = {file = "LICENSE.txt"}
readme = "README.rst"
dynamic = ["version"]
classifiers = [
"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",
"Programming Language :: Python :: 3.13",
]
requires-python = ">=3.10,<3.14"
dependencies = [
"adlfs>=2023.9.0, <2024.13.0",
"fsspec>=2022.11.0, <2024.13.0",
"orjson >= 3.8, < 3.11",
"pandas >= 1.4,< 2.3",
"platformdirs >3.0,<4.4",
"polars>=0.20,<1.21",
"pyarrow>=9, <20",
"s3fs>=2022.11.0, <2024.13.0",
"tzdata>=2022.7; platform_system=='Windows'",
]
# entry points
scripts.rmi = "etoolbox.main:main"
[project.optional-dependencies]
dev = [
"build>=0.9",
"ruff>0.0.215,<0.9.4",
"tox>=4.16.0,<4.25",
"twine>=4.0",
]
doc = [
"doc8>=0.9,<1.2", # Ensures clean documentation formatting
"furo>=2022.4.7", # A clean customisable Sphinx documentation theme.
"rstcheck[sphinx,toml]>=5.0,<6.3", # ReStructuredText linter
"sphinx>=4,!=5.1.0,<8.1.4",
"sphinx-autoapi>=1.8,<3.5",
"sphinx-issues>=1.2,<5.1",
"sphinx-autodoc-typehints>1.19,<3.0.2",
"sphinxcontrib-mermaid>0.7,<1.1.0",
]
tests = [
"coverage>=5.3,<7.7", # Lets us track what code is being tested
"pre-commit>=2.9,<4.2", # Allow us to run pre-commit hooks in testing
"pytest>=6.2,<8.4", # test framework
"pytest-console-scripts>=1.1,<1.5", # Allow automatic testing of scripts
"pytest-cov>=2.10,<6.1", # Pytest plugin for working with coverage
"ruff>0.0.215,<0.9.4",
"tox>=4.16.0,<4.25", # Python test environment manager
"tqdm >= 4.63,< 4.68",
"requests_mock", # used by remote_zip tests
"pytest-socket", #
]
optional = [
"plotly>5.10,<5.25",
"sqlalchemy>1.4,<2.1",
]
pudl-test = []
[tool.setuptools.dynamic]
version = {attr = "etoolbox._version.__version__"}
[tool.setuptools_scm]
write_to = "src/etoolbox/_version.py"
#######################################################################################
# Configurations for linters and other tools
#######################################################################################
[tool.doc8]
max-line-length = 88
ignore-path = "docs/_build"
[tool.pytest.ini_options]
testpaths = ["."]
addopts = ["--verbose", "--doctest-modules"]
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 = "WARNING"
doctest_optionflags = ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL", "ELLIPSIS"]
filterwarnings = [
"ignore:distutils Version classes are deprecated:DeprecationWarning",
"ignore:Creating a LegacyVersion:DeprecationWarning:pkg_resources[.*]",
]
[tool.rstcheck]
report_level = "WARNING"
ignore_roles = ["pr", "issue", "user", "include"]
ignore_messages = '(Hyperlink target .* is not referenced\.$|Duplicate implicit target name:|An `AttributeError` error occured.*)'
ignore_directives = ["bibliography", "todo", "include"]
[tool.ruff]
line-length = 88
show-fixes = true
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
".pixi",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
[tool.ruff.format]
# Enable reformatting of code snippets in docstrings.
docstring-code-format = true
[tool.ruff.lint]
select = [ # https://beta.ruff.rs/docs/rules/
"A", # flake8-builtins
"B", # flake8-bugbear
"C",
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"E", # pycodestyle
"F", # Pyflakes
"FBT", # flake8-boolean-trap
"G", # flake8-logging-format
"I", # isort
"TID", # flake8-tidy-imports
"N", # pep8-naming
"PD", # pandas
"PT", # flake8-pytest-style
"PGH", # pygrep-hooks
"S", # bandit
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"UP", # pyupgrade
"W", # pycodestyle
"RUF", # Ruff-specific rules
"Q", # flake8-quotes
]
ignore = [
"D105",
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line of docstring should be in imperative mood: "{first_line}"
"D407", # dashed-underline-after-section, upsets Sphinx
"D416",
# conflict with ruff format
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
]
flake8-tidy-imports.ban-relative-imports = "all"
flake8-type-checking.strict = true
mccabe.max-complexity = 15 # Unlike Flake8, default to a complexity level of 10.
pycodestyle.max-doc-length = 88
pydocstyle.convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"docs/conf.py" = ["E501"]
"docs/benchmarks.py" = ["D103", "S301", "S311"]
"tests/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"F841", # Local variable `pudl` is assigned to but never used
"FBT003", # Boolean positional value in function call, can't fix it pytest.param
"PD901",
"PT006", # Wrong name(s) type in `@pytest.mark.parametrize`, expected `tuple`
"PT011", # `pytest.raises(ValueError)` is too broad, set the `match` parameter or use a more specific exception
"S101", # Use of `assert` detected
"SIM117", # Use a single `with` statement with multiple contexts instead of nested `with` statements
]
"tests/unit/utils_remote_zip_test.py" = ["D102", "D103", "D107", "FBT002"]
"_test_classes.py" = ["FBT003"]
"table_map.py" = ["D103", "E501"]
"pudl_helpers.py" = ["PD901"]