-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathpyproject.toml
More file actions
154 lines (142 loc) · 3.62 KB
/
Copy pathpyproject.toml
File metadata and controls
154 lines (142 loc) · 3.62 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
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "monty"
maintainers = [
{ name = "Shyue Ping Ong", email = "shyuep@gmail.com" },
]
description = "Monty is the missing complement to Python."
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"ruamel.yaml",
"numpy",
]
version = "2026.7.16"
[project.optional-dependencies]
# dev is for "dev" module, not for development
dev = ["ipython"]
json = [
"pymongo",
"orjson>=3.6.1",
"pandas",
"pydantic",
"pint",
# Note: need torch>=2.3.0 for numpy 2 # 719
"torch",
]
multiprocessing = ["tqdm"]
optional = ["monty[dev,json,multiprocessing,serialization]"]
serialization = ["msgpack"]
[tool.setuptools.packages.find]
where = ["src"]
include = ["monty", "monty.*"]
[tool.black]
line-length = 120
target-version = ["py311"]
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| tests
)/
)
'''
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_also = [
"@deprecated",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"pragma: no cover",
"raise AssertionError",
"raise NotImplementedError",
"show_plot",
"if TYPE_CHECKING:",
"except ImportError:"
]
[tool.mypy]
ignore_missing_imports = true
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort
"PERF", # perflint
"PL", # pylint
"PIE", # flake8-pie
"RET", # flake8-return
"RUF", # ruff-specific
"SIM", # flake8-simplify
"TC", # flake8-type-checking
"UP", # pyupgrade
]
ignore = [
"PLR2004", # magic value comparison (too noisy)
"PLR0911", # too many return statements
"PLR0912", # too many branches
"PLR0913", # too many arguments
"PLR0915", # too many statements
"PLW2901", # redefined loop name (idiomatic in places)
"PERF203", # try/except inside loop
"PLC0415", # imports inside functions for optional deps
"SIM105", # contextlib.suppress (occasionally clearer as try/except)
"SIM115", # context manager for files (already-yielded fds)
"RUF012", # mutable class attribute should be ClassVar
"TC006", # quote types in typing.cast() (no real benefit)
]
[tool.ruff.lint.per-file-ignores]
"src/monty/io.py" = ["PLC0414"] # intentional re-export of EncodingWarning
"src/monty/termcolor.py" = ["PLW0603"] # intentional global toggle
"tests/**" = ["B", "PL", "PERF", "RET", "RUF043", "SIM"]
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
known-first-party = ["monty"]
[tool.uv]
default-groups = "all"
[dependency-groups]
dev = [
"coverage>=7.7.1",
"pre-commit>=4.2.0",
"pytest>=8.3.5",
"pytest-benchmark>=5.2.3",
"pytest-cov>=6.0.0",
]
lint = [
"mypy>=1.15.0",
"ruff>=0.11.2",
]
maintain = [
"sphinx>=7.4.7",
"sphinx-rtd-theme>=3.0.2",
"requests",
"invoke",
"myst-parser",
"sphinx-markdown-builder",
"roman-numerals",
]