Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
216 lines (196 loc) · 6.47 KB
/
Copy pathpyproject.toml
File metadata and controls
216 lines (196 loc) · 6.47 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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[build-system]
# 1.27 is where hatchling learned PEP 639, i.e. the `license` expression
# and `license-files` below.
requires = ["hatchling>=1.27", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "formulate"
authors = [
{ name = "Chris Burr", email = "c.b@cern.ch" },
{ name = "Aryan Roy", email = "aryanroy5678@gmail.com" },
{ name = "Jonas Eschle", email = "jonas.eschle@gmail.com" },
{ name = "Andres Rios-Tascon", email = "ariostas@gmail.com" }
]
maintainers = [
{ name = "The Scikit-HEP admins", email = "scikit-hep-admins@googlegroups.com" },
]
description = " Easy conversions between different styles of expressions"
readme = "README.md"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"hepunits>=2.4.0",
"lark>=1.3",
"ordered-set",
]
[project.optional-dependencies]
# formulate only rewrites expression strings, so nothing is needed to import
# it. What people reach for next is an engine to evaluate the NumExpr output
# with, hence `pip install formulate[numexpr]`.
numexpr = ["numexpr"]
# Everything below is for working *on* formulate, and is a dependency group
# rather than an extra: none of it is useful to an installed copy, so none of
# it has any business being published with one. Install with
# `pip install -e . --group dev`, or `uv sync`.
[dependency-groups]
test = [
"pytest>=6",
"pytest-cov>=3",
"hypothesis",
"numpy",
"numexpr",
]
docs = [
"sphinx>=5.0",
"myst_parser>=0.13",
"sphinx-book-theme>=0.1.0",
"sphinx_copybutton",
"sphinx_rtd_theme",
"sphinx-autodoc-typehints",
"jupyter-sphinx>=0.3.2",
"numexpr",
]
dev = [{ include-group = "test" }, { include-group = "docs" }, "prek"]
[project.urls]
Homepage = "https://github.com/Scikit-HEP/formulate"
"Bug Tracker" = "https://github.com/Scikit-HEP/formulate/issues"
Discussions = "https://github.com/Scikit-HEP/formulate/discussions"
Changelog = "https://github.com/Scikit-HEP/formulate/releases"
[project.scripts]
formulate = "formulate.cli:main"
[tool.uv]
exclude-newer = "7 days"
[tool.hatch]
version.source = "vcs"
build.hooks.vcs.version-file = "src/formulate/_version.py"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
log_level = "INFO"
testpaths = [
"tests",
]
# Coverage is measured with branches and required to be complete, matching what
# codecov.yml enforces on a pull request. Keeping it here rather than in the CI
# invocation means `pytest --cov=formulate` and `nox -s coverage` hold a change
# to the same standard before it is pushed. The full suite reaches 100% without
# ROOT installed, so every job in the matrix can meet this, not just the one
# that uploads.
[tool.coverage.run]
branch = true
source = ["formulate"]
[tool.coverage.report]
fail_under = 100
# Only the default. The `raise NotImplementedError` exclusion this replaces was
# redundant: both raises sit under an `else:` already marked `# pragma: no
# cover`, which is how this package spells genuinely unreachable code.
exclude_lines = ["pragma: no cover"]
[tool.mypy]
files = "src"
python_version = "3.11"
warn_unused_configs = true
strict = true
hide_error_codes = false
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
[[tool.mypy.overrides]]
module = ["hepunits.*", "lark", "ordered_set", "formulate._version"]
ignore_missing_imports = true
[tool.ruff.lint]
select = [
"E", "F", "W", # flake8
"B", "B904", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
"FA", # flake8-future-annotations
"FLY", # flynt
"DTZ", # flake8-datetimez
"TC", # flake8-type-checking
"BLE", # flake8-blind-except
"PYI", # flake8-pyi
"T10", # flake8-debugger
"LOG", # flake8-logging
"Q", # flake8-quotes
"FURB", # refurb
"SLOT", # flake8-slots
"TRY", # tryceratops
"RSE", # flake8-raise
"PERF", # perflint
]
ignore = [
# Design: too many branches, returns, arguments. `_expand` is a dispatcher
# over parse-tree node types, so its branch count is the language's, not a
# tangle to be broken up -- which is why pylint's own `design` messages are
# off below as well. The rest of PLR is on.
"PLR09",
# Magic value in comparison: the values it finds are arities (`!= 2` for a
# binary operator's operands), where the literal is the clearest spelling.
"PLR2004",
]
flake8-unused-arguments.ignore-variadic-names = true
[tool.pylint]
py-version = "3.11"
ignore-paths = ["src/formulate/_version.py"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
# pylint's default, plus `AST`: `formulate.AST` is public API, so the module
# cannot be renamed to snake_case without breaking imports.
basic.module-rgx = "(([a-z_][a-z0-9_]*)|(AST))$"
# The node protocol -- see AST.py. These are private to the package rather than
# to the instance: the base class and `fold` deliberately call them on nodes
# other than self, which is what makes every traversal live in one place. The
# remainder are pylint's own defaults, kept.
classes.exclude-protected = [
"_children",
"_format",
"_serializer",
"_asdict",
"_fields",
"_replace",
"_source",
"_make",
]
messages_control.disable = [
"design",
"fixme",
"line-too-long",
"missing-module-docstring",
"wrong-import-position",
]