generated from catalyst-cooperative/cheshire
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
235 lines (212 loc) · 7.06 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
235
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=66,<76",
"setuptools_scm[toml]>=3.5.0",
"wheel",
]
[project]
# This should be the *installed* package name e.g. catalystcoop.pudl not pudl
name = "catalystcoop.mozilla-sec-eia"
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 = "[email protected]"}
]
requires-python = ">=3.10,<3.12"
dynamic = ["version"]
license = {file = "LICENSE.txt"}
dependencies = [
"accelerate>=0.21.0,<2.0", # Hugging Face dependency for PyTorch models
"cloud-sql-python-connector[pg8000]",
"dagster>=1.7.15", # 1.7.13 & 1.7.14 were both breaking things
"dagster-mlflow",
"dagster-webserver",
"dagster-pandera",
"dagstermill",
"datasets>=2.1,<4", # Access Hugging Face datasets
"seqeval>=1.2,<2", # Sequence labeling evaluation
"google-cloud-secret-manager>=2,<3",
"google-cloud-storage>=2,<3",
"hypothesis",
"matplotlib>=3.8,<4",
"mlflow>=2.12",
"opencv-python",
"coloredlogs>=14.0",
"pandas[parquet,excel,fss,gcp,compression]>=2,<3",
"pandera>=0.18",
"pg8000",
"psutil",
"pynvml",
"pillow>=10.2,<12",
"pydantic[email]>=2,<3",
"pydantic-settings>=2",
"python-bidi<0.7.0",
"pymupdf", # Convert PDF to image
"sqlalchemy>=2,<3",
"timm>0.9,<2", # dependency for Hugging Face computer vision models
"torch>=2.2,<3",
"transformers>=4.42.3,<=4.47.1",
"xhtml2pdf", # Convert html to PDF files
]
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",
]
keywords = [
"template",
"testing",
"linting",
"github actions",
"continuous integration",
"continuous delivery",
]
[project.scripts]
# "script_name = dotted.module.path.to:main_script_function",
mozilla_dev = "mozilla_sec_eia.cli:main"
[project.urls]
# "Homepage" = ""
"Source" = "https://github.com/catalyst-cooperative/mozilla-sec-eia"
"Documentation" = "https://catalystcoop-mozilla-sec-eia.readthedocs.io"
"Issue Tracker" = "https://github.com/catalyst-cooperative/mozilla-sec-eia/issues"
[project.optional-dependencies]
dev = [
"build>=1,<2", # The setuptools package builder
"black>=22,<25", # A deterministic code formatter
# "label-studio>=1.12,<2.0", # Tool for labeling training data, exclude until pydantic upgrade
"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,<8.2", # 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>=3,<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
"pytest-mock>=3.0,<3.15", # Pytest plugin for mocking function calls and objects
"ruff>=0.0.290", # 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.black]
line-length = 88
target-version = ["py310", "py311"]
include = "\\.pyi?$"
[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]
exclude = ["notebooks/*"]
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
]
lint.ignore = [
"D401", # Require imperative mood in docstrings.
"D417",
"E501", # Overlong lines.
"PD003", # Use of isna rather than isnull
"PD004", # Use of notna rather than notnull
"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
"EXE002",
]
# Assume Python 3.11
target-version = "py311"
line-length = 88
# Don't automatically concatenate strings -- sometimes we forget a comma!
lint.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 = ["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