-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
196 lines (177 loc) · 5.13 KB
/
pyproject.toml
File metadata and controls
196 lines (177 loc) · 5.13 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "cmm-data"
version = "0.1.0"
description = "Critical Minerals Modeling data access library"
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
authors = [
{ name = "CMM Team", email = "cmm@pnnl.gov" }
]
keywords = ["critical minerals", "supply chain", "data", "USGS", "OECD"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
dependencies = [
"pandas>=2.0.0",
"numpy>=1.24.0",
"httpx>=0.27.0",
"google-search-results>=2.4.0",
"python-dotenv>=1.0.0",
]
[project.optional-dependencies]
geo = [
"geopandas>=0.14.0",
"rasterio>=1.3.0",
"fiona>=1.9.0",
]
viz = [
"matplotlib>=3.7.0",
"plotly>=5.15.0",
]
dev = [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"ruff>=0.1.0",
"mypy>=1.0.0",
"pre-commit>=3.0.0",
"bandit>=1.7.0",
]
full = ["cmm-data[geo,viz,dev]"]
[project.urls]
Homepage = "https://github.com/PNNL-CMM/cmm-data"
Documentation = "https://pnnl-cmm.github.io/cmm-data/"
Repository = "https://github.com/PNNL-CMM/cmm-data"
Issues = "https://github.com/PNNL-CMM/cmm-data/issues"
Changelog = "https://github.com/PNNL-CMM/cmm-data/blob/main/CHANGELOG.md"
[tool.hatch.build.targets.wheel]
packages = ["src/cmm_data"]
# Ruff configuration
[tool.ruff]
target-version = "py39"
line-length = 100
src = ["src"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"PTH", # flake8-use-pathlib
"ERA", # eradicate (commented out code)
"PL", # pylint
"RUF", # Ruff-specific rules
]
ignore = [
"E402", # module import not at top of file (intentional in some modules)
"E501", # line too long (strings; ruff format handles code lines)
"B008", # do not perform function calls in argument defaults
"PLC0415", # import not at top level (intentional in test/main functions)
"ERA001", # commented-out code
"PTH123", # builtin-open (prefer pathlib.Path.open eventually)
"RUF012", # mutable-class-default (ClassVar annotation)
"B904", # raise-without-from-inside-except
"B007", # unused-loop-control-variable
"PLW0603", # global-statement
"PLR0913", # too many arguments
"PLR2004", # magic value comparison
"PLR0912", # too many branches
"PLR0915", # too many statements
"PLR0911", # too-many-return-statements
"ARG001", # unused-function-argument
"ARG002", # unused-method-argument
"SIM117", # multiple-with-statements
"SIM114", # if-with-same-arms
"PLC0206", # dict-index-missing-items
"PLW0127", # self-assigning-variable
"PLW2901", # redefined-loop-name
"PTH122", # os-path-splitext
"B905", # zip-without-explicit-strict
"RUF059", # unused-unpacked-variable
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports in __init__
"tests/*" = ["ARG", "PLR"] # allow unused args and complexity in tests
"examples/*" = ["F401"] # availability checks
"scripts/*" = ["F401"] # availability checks
"src/cmm_data/loaders/mindat.py" = ["F401"] # availability check
"src/cmm_data/loaders/netl_ree.py" = ["F401"] # availability check
[tool.ruff.lint.isort]
known-first-party = ["cmm_data"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
# MyPy configuration
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true
exclude = [
"tests",
"docs",
"examples",
]
[[tool.mypy.overrides]]
module = "pandas.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "numpy.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "matplotlib.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "geopandas.*"
ignore_missing_imports = true
# Pytest configuration
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
# Coverage configuration
[tool.coverage.run]
source = ["src/cmm_data"]
branch = true
omit = [
"*/tests/*",
"*/__init__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
show_missing = true
fail_under = 50
# Bandit configuration
[tool.bandit]
exclude_dirs = ["tests", "docs", "examples"]
skips = ["B101"] # assert statements are fine in non-production code