-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
180 lines (159 loc) · 5.3 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
[project]
name = "pudl_usage_metrics"
version = "0.1.0"
authors = [{name = "PUDL", email = "[email protected]"}]
requires-python = ">=3.12,<3.13"
dependencies = [
"pandas>=2.2,<2.3",
"sqlalchemy>=2",
"dagster>=1.7.15, <1.9.2",
"dagster-webserver>=1.7.15,<1.10",
"pandas-gbq>=0.23.1",
"pydata-google-auth>=1.8.2",
"jupyterlab>=4.2.3",
"psycopg2-binary>=2.9.9",
"ipinfo>=5.0.1",
"joblib>=1.4.2",
"matplotlib>=3.9.0",
"pg8000>=1.31.1",
"cloud-sql-python-connector[pg8000]>=1.11.0",
"google-cloud-storage>=2.17",
"kaggle>=1.6.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.12",
]
[project.optional-dependencies]
dev = [
"black>=22,<25", # A deterministic code formatter
"isort>=5,<6", # Standardized import sorting
"twine>=3.3,<6.0", # Used to make releases to PyPI
"tox>=4.16,<4.24", # Python test environment manager
]
docs = [
"doc8>=0.9,<1.2", # Ensures clean documentation formatting
"sphinx>=4,<9", # The default Python documentation redering engine
"sphinx-autoapi>=1.8,<4", # Generates documentation from docstrings
"sphinx-issues>=1.2,<6.0", # Allows references to GitHub issues
"sphinx-rtd-dark-mode>=1.2,<2", # Allow user to toggle light/dark mode
"sphinx-rtd-theme>=1,<4", # Standard Sphinx theme for Read The Docs
]
tests = [
"coverage>=5.3,<8", # Lets us track what code is being tested
"doc8>=0.9,<1.2", # Ensures clean documentation formatting
"pre-commit>=4,<5", # Allow us to run pre-commit hooks in testing
"pydocstyle>=5.1,<7", # Style guidelines for Python documentation
"pytest>=8,<8.4", # Our testing framework
"pytest-asyncio>=0.20,<0.25", # Test async functions
"pytest-console-scripts>=1.4.1,<2", # Allow automatic testing of scripts
"pytest-cov>=5.0.0", # Pytest plugin for working with coverage
"pytest-mock>=3.14,<3.15", # Pytest plugin for mocking function calls and objects
"ruff>=0.4,<0.8",
]
[project.scripts]
pudl_usage_metrics = "pudl_usage_metrics.cli:main"
[build-system]
requires = [
"setuptools>=66",
]
build-backend = "setuptools.build_meta"
[tool.doc8]
max-line-length = 88
ignore-path = ["docs/_build"]
[tool.pytest.ini_options]
testpaths = "./"
filterwarnings = [
"ignore:distutils Version classes are deprecated:DeprecationWarning",
"ignore:Creating a LegacyVersion:DeprecationWarning:pkg_resources[.*]",
]
addopts = "--verbose"
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 = "INFO"
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
[tool.ruff]
# Assume Python 3.12
target-version = "py312"
line-length = 88
indent-width = 4
exclude = ["migrations/versions", "*.ipynb"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
"A", # flake8-builtins
# "ARG", # unused arguments
# "B", # flake8-bugbear
"C", # Limit cyclomatic complexity using mccabe
"D", # pydocstyle errors
"E", # pycodestyle errors
"EXE", # executable file issues
# "ERA", # eradicate: find commented out code
"F", # pyflakes
"I", # isort
"ISC", # implicit string concatenation
"N", # pep8-naming
"NPY", # NumPy specific checks
"PD", # pandas checks
"PGH", # pygrep-hooks
# "PL", # pylint
# "PT", # pytest style
"PTH", # use pathlib
"Q", # flake8-quotes
"RET", # check return values
"RSE", # unnecessary parenthises on raised exceptions
"S", # flake8-bandit
"SIM", # flake8-simplify
# "T", # print statements found
"UP", # pyupgrade (use modern python syntax)
"W", # pycodestyle warnings
]
ignore = [
"D401", # Require imperative mood in docstrings.
"D417",
"E501", # Overlong lines.
"E203", # Space before ':' (black recommends to ignore)
"PD003", # Use of isna rather than isnull
"PD004", # Use of notna rather than notnull
"PD008", # Use of df.at[] rather than df.loc[]
"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
]
# Don't automatically concatenate strings -- sometimes we forget a comma!
unfixable = ["ISC"]
[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 = ["ferc_xbrl_extractor"]
[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"