-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpyproject.toml
More file actions
208 lines (186 loc) · 5.89 KB
/
Copy pathpyproject.toml
File metadata and controls
208 lines (186 loc) · 5.89 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "pyhdtoolkit/version.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/docs",
"/docker",
"/examples",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["pyhdtoolkit"]
# ----- Project Metadata ----- #
[project]
name = "pyhdtoolkit"
readme = "README.md"
description = "An all-in-one toolkit package to ease my Python work in my PhD."
authors = [
{name = "Felix Soubelet", email = "felix.soubelet@cern.ch"},
]
license = "MIT"
dynamic = ["version"]
requires-python = ">=3.11"
keywords = [
"PHD",
"Accelerator Physics",
"Physics Simulation",
"Visualisation",
"Docker",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Utilities",
]
dependencies = [
# -- Core scientific -- #
"numpy >= 2.0",
"pandas >= 2.0",
"matplotlib >=3.7",
"scipy >= 1.10",
# -- Domain specific -- #
"cpymad >= 1.16",
"tfs-pandas >= 3.8",
"optics-functions >= 0.1",
# -- Utilities -- #
"loguru < 1.0",
"pydantic >= 2.0",
]
[project.optional-dependencies]
monitor = [
"typer > 0.20",
"rich >= 13.0",
"pendulum >= 3.0",
]
test = [
"pyhdtoolkit[monitor]", # htc stuff is tested
"pytest >= 8.0",
"pytest-cov >= 6.0",
"pytest-xdist >= 3.0",
"numba >= 0.60.0", # for @maybe_jit
"flaky >= 3.5",
"pytest-randomly >= 3.10",
"coverage[toml] >= 7.0",
"pytest-mpl >= 0.14",
]
dev = [
"ruff >= 0.12",
]
docs = [
"joblib >= 1.0",
"Sphinx >= 8.0",
"sphinx-rtd-theme >= 3.0",
"sphinx-issues >= 5.0",
"sphinx_copybutton < 1.0",
"sphinxcontrib-bibtex >= 2.4",
"sphinx-design >= 0.6",
"sphinx-gallery < 1.0",
"sphinx-prompt >= 1.5",
"sphinx_codeautolink>=0.14",
]
all = [
"pyhdtoolkit[dev]",
"pyhdtoolkit[docs]",
"pyhdtoolkit[test]",
"pyhdtoolkit[monitor]",
]
[project.scripts]
htc-monitor = "pyhdtoolkit.scripts.htc_monitor:app"
[project.urls]
homepage = "https://github.com/fsoubelet/PyhDToolkit"
repository = "https://github.com/fsoubelet/PyhDToolkit"
documentation = "https://fsoubelet.github.io/PyhDToolkit"
changelog = "https://fsoubelet.github.io/PyhDToolkit/release.html"
# ----- Some uv Specifics ----- #
[tool.uv]
# no-build = true # don't allow arbitrary python code by default
exclude-newer = "10 days" # dependency cooldown, since the world is mad
[tool.uv.pip]
compile-bytecode = true
# ----- Testing Configuration ----- #
[tool.pytest.ini_options]
addopts = "--mpl --no-flaky-report --cov-report=xml --cov-report term-missing --cov-config=pyproject.toml --cov=pyhdtoolkit"
testpaths = ["tests"]
[tool.coverage.run]
source = ["pyhdtoolkit/"]
[tool.coverage.report]
ignore_errors = true
omit = [
"pyhdtoolkit/cpymadtools/setup.py",
"pyhdtoolkit/utils/htcondor.py",
"pyhdtoolkit/scripts/htc_monitor.py",
]
exclude_also = [
"if TYPE_CHECKING:", # do not count if TYPE_CHECKING block imports (ignored at runtime) for coverage
"except ImportError:", # do not count missing optional dependencies set to None, we monkeypatch and test that
]
precision = 2
# ----- Dev Tools Configuration ----- #
[tool.ruff]
target-version = "py311" # Assume Python 3.11+.
line-length = 120
exclude = ["pyhdtoolkit/cpymadtools/lhc/__init__.py"]
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
ignore = [
"E501", # line-too-long
"FBT001", # boolean-type-hint-positional-argument
"FBT002", # boolean-default-value-positional-argument
"PT019", # pytest-fixture-param-without-value (but suggested solution fails)
"RUF100", # detects unused noqa but is wrong
"PLR0913", # Expects no more than 5 arguments per function, too low
"PLR0915", # Expects no more than 50 statements per function, too low
]
extend-select = [
"A", # Detect shadowed builtins
"E", # PyCodeStyle errors
"F", # Pyflakes rules
"I", # Sort imports properly
"N", # enforce naming conventions, e.g. ClassName vs function_name
"W", # PyCodeStyle warnings
"C4", # Catch incorrect use of comprehensions, dict, list, etc
"FA", # Enforce from __future__ import annotations
"PD", # Good pandas practices
"PL", # Pylint rules
"PT", # Enforce pytest conventions
"TC", # Enforce importing certain types in a TYPE_CHECKING block
"UP", # Warn if certain things can changed due to newer Python versions
"ARG", # Detect unused arguments
"BLE", # disallow catch-all exceptions
"DTZ", # Good datetime practices
"FBT", # detect boolean traps
"FLY", # Prefer idiomatic expressions over string joins
"ICN", # Use common import conventions
"ISC", # Good use of string concatenation
"LOG", # Good logging practices
"NPY", # Some numpy-specific things
"PIE", # No pointless statements
"PTH", # Use pathlib instead of os.path
"RET", # Good return practices
"RUF", # Ruff specific rules
"SIM", # Common simplification rules
"TID", # Some good import practices
"TRY", # Good try/except practices
"FURB", # Refurbishing rules
"PERF", # Good performance practices
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []