-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
315 lines (287 loc) · 8.47 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
[build-system]
# pdm
requires = ["pdm-backend"]
build-backend = "pdm.backend"
# hatch
#requires = ["hatchling"]
#build-backend = "hatchling.build"
[project]
name = "mammoth"
authors = [
{ name = "Raymond Ehlers", email = "raymond.ehlers@cern.ch" },
]
description = "Mostly columnar based physics analyses"
readme = "README.md"
license.file = "LICENSE"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"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",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"awkward >=2.0.8",
"uproot >=4.2",
"numpy >=1.21",
"scipy >=1.11.3",
"pyarrow >=4",
"pyhepmc >=2.12.0",
"pandas >=2.0",
"attrs >=21.2.0",
"particle >=0.15.1",
"numba >=0.56.0",
"boost-histogram >=1.5",
"hist[plot] >=2.8",
"seaborn >=0.11.2",
"vector >=0.8.5",
"parsl[monitoring] >=2023.10.23",
"rich >=v13.4.0",
# My packages last:
# - mammoth_cpp
# For general:
#"mammoth_cpp >=0.1",
# For pdm:
"mammoth_cpp @ file:///${PROJECT_ROOT}/mammoth-cpp",
# For hatch:
#"mammoth_cpp @ file://{root:uri}/mammoth-cpp",
# - pachyderm
# For pdm: it's in the dev dependencies since we want it to be editable, but we can
# copy it twice, see here: https://github.com/pdm-project/pdm/discussions/1479
"pachyderm >= 3.0",
# For hatch: we can install it locally (but not editable) with:
#"pachyderm @ file://{root:uri}/external/pachyderm",
"dask[distributed,diagnostics]>=2022.12.0",
"dask-jobqueue>=0.8.1",
"rich-argparse>=1.4.0",
"strenum>=0.4.15; python_version < \"3.11\"",
]
[project.optional-dependencies]
test = [
"pytest >=6.2.4",
"pytest-cov >=3",
"pytest-sugar >=0.9.5",
]
docs = [
"sphinx>=7.0",
"myst_parser>=0.13",
"sphinx_copybutton",
"sphinx_autodoc_typehints",
"furo>=2023.08.17",
]
# NOTE: We use this for the dev dependencies because we need the PDM support for local
# editable repositories. If we ever don't need that, we can just move it to the
# standard compliant groups in `[project.optional-dependencies]` (eg. if moving to hatch)
[tool.pdm.dev-dependencies]
dev = [
"ruff >=0.0.209",
"mypy >=0.931",
"ipython >=8.0",
"ipykernel >=6.15.1",
"pytest >=6.2.4",
"pytest-cov >=3",
"pytest-sugar >=0.9.5",
"pytest-xdist >=3.1.0",
# Included so we can grab the headers for vscode (also so that we can build in the env if we want)
"pybind11 >=2.10",
# pachyderm
# pdm requires editable dependencies to be in the dev dependencies
"-e file:///${PROJECT_ROOT}/external/pachyderm#egg=pachyderm",
]
[project.scripts]
shadd = "mammoth.framework.io.output_utils:shit_hadd"
handle_files_from_failed_jobs = "mammoth.job_file_management_utils:steer_handle_files_from_failed_jobs_entry_point"
count_events_in_track_skim = "mammoth.framework.io.track_skim_utils:count_events_in_track_skim_entry_point"
[project.urls]
Homepage = "https://github.com/raymondEhlers/mammoth"
"Bug Tracker" = "https://github.com/raymondEhlers/mammoth/issues"
Discussions = "https://github.com/raymondEhlers/mammoth/discussions"
Changelog = "https://github.com/raymondEhlers/mammoth/releases"
[tool.hatch]
version.path = "src/mammoth/__init__.py"
[tool.pdm.version]
source = "scm"
write_to = "mammoth/_version.py"
write_template = "version = '{}'"
[tool.pdm.build]
excludes = [
"tests/track_skim_validation/input/alice",
"tests/track_skim_validation/**/*.root",
"tests/track_skim_validation/**/*.parquet",
"tests/track_skim_validation/**/*.pdf",
"**/.mypy_cache/",
]
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = [
"error",
# Temporarily until this is resolved: https://github.com/dateutil/dateutil/issues/1314
# NOTE: It is coming from dateutil, which is used by matplotlib + pandas
"ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil.tz.tz",
]
#log_level = "INFO"
#log_cli_level = "DEBUG"
testpaths = [
"tests",
]
[tool.coverage]
run.source = ["mammoth"]
report.exclude_also = [
'\.\.\.',
'if typing.TYPE_CHECKING:',
]
[tool.mypy]
files = ["src", "tests"]
python_version = "3.10"
warn_unused_configs = true
strict = true
show_error_codes = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true
no_implicit_reexport = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
exclude = [".venv*"]
[[tool.mypy.overrides]]
module = "mammoth.*"
disallow_untyped_defs = true
disallow_incomplete_defs = true
[[tool.mypy.overrides]]
module = [
"boost_histogram",
"coloredlogs",
"cycler",
"dask.*",
"enlighten",
"jet_substructure.*",
"IPython",
"matplotlib.*",
"mplhep",
"networkx.*",
"numba",
"numpy",
"pandas",
"pyarrow.*",
"parsl.*",
"ROOT",
"seaborn",
"scipy.interpolate",
"scipy",
"strenum", # Only for python 3.10 and below
"uproot",
"pyhepmc",
"awkward",
"ruamel.*",
"dask_jobqueue",
"rich_argparse",
# NOTE: Many of these are not direct dependencies, but implicit dependencies of actual dependencies.
# For some reason, this fails occasionally, and the easiest response is just to ignore.
# pre-commit + mypy really is extraordinarily painful...
"traitlets.*",
"tornado.*",
"paramiko",
"jupyter",
"jupyter_server",
]
ignore_missing_imports = true
[tool.ruff]
src = ["src"]
line-length = 120
exclude = [
'.git',
'.env',
'.env3',
'.venv',
'.venv*',
'env',
'__pycache__',
'bak',
'build',
'dist',
"src/*/_version.py",
"projects/jetscape/summer_school_2022",
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"C901", # mccabe
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"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
]
ignore = [
"PLR09", # Too many <...>
"PLR2004", # Magic value used in comparison
"ISC001", # Conflicts with formatter
"ISC003", # Force string to be implicitly concatenated. However, I find this structure to be useful for better
# readability due to consistent spacing with plotting labels.
"G004", # Logging format string. This isn't best practices, but I use it too much to change for now
"PLC0414", # Messes with the re-export of imports needed from mypy
"PD011", # Calls to `.values` are usually for histograms, not pandas. This is getting picked up as a false positive
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]
"noxfile.py" = ["T20"]
"projects/**" = [
"T20", # Print statements are fairly common in jupyter notebooks
"E402", # Module level import not at top of file are fairly common in notebooks
"F841", # Again, unused variables are common in notebooks
"B018", # For useless variables. Sometimes we have useless statements to print them
]
[tool.ruff.lint.mccabe]
max-complexity = 12
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
known-first-party = ["mammoth", "mammoth_cpp"]
[tool.pylint]
py-version = "3.10"
ignore-paths = [".*/_version.py"]
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
"design",
"fixme",
"line-too-long",
"missing-module-docstring",
"wrong-import-position",
]
[tool.codespell]
ignore-words-list = "subjet, gaus, fpt, slac"
[tool.check-manifest]
ignore = [
".github/**",
"docs/**",
".pre-commit-config.yaml",
".readthedocs.yml",
"src/*/_version.py",
"noxfile.py",
]