-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
162 lines (142 loc) · 4.2 KB
/
pyproject.toml
File metadata and controls
162 lines (142 loc) · 4.2 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "pylhc/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/doc",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["pylhc"]
[project]
name = "pylhc"
readme = "README.md"
description = "An accelerator physics script collection for the OMC team at CERN."
authors = [
{name = "OMC Team", email = "pylhc@github.com"}, # see zenodo file / commits for details
]
license = "MIT"
dynamic = ["version"]
requires-python = ">=3.10"
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"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 :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"numpy >= 1.24",
"scipy >= 1.10",
"pandas[timezone] >= 2.1",
"matplotlib >= 3.8",
"tfs-pandas >= 3.8",
"generic-parser >= 1.1",
"parse >= 1.15",
"omc3 >= 0.15",
"jpype1 >= 1.3",
]
[project.optional-dependencies]
cern = [
"omc3[cern] >= 0.15",
"pjlsa >= 0.2",
"pytimber >= 3.0", # NXCALS support
"pyjapc; python_version < '3.12'",
]
test = [
"pytest>=7.0",
"pytest-cov>=2.9",
"pytest-mpl>=0.15",
]
doc = [
"sphinx >= 7.0",
"sphinx_rtd_theme >= 2.0",
]
all = [
"pylhc[cern]",
"pylhc[test]",
"pylhc[doc]",
]
[project.urls]
homepage = "https://github.com/pylhc/PyLHC"
repository = "https://github.com/pylhc/PyLHC"
documentation = "https://pylhc.github.io/PyLHC/"
changelog = "https://github.com/pylhc/PyLHC/blob/master/CHANGELOG.md"
# ----- Testing ----- #
[tool.pytest.ini_options]
markers = [
"cern_network: tests that require access to afs or the technical network",
]
addopts = [
"--import-mode=importlib",
]
# Helpful for pytest-debugging (leave commented out on commit):
# log_cli=true
# log_level=DEBUG
[tool.coverage.run]
relative_files = true
[tool.coverage.report]
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
]
# ----- Dev Tools Configuration ----- #
[tool.ruff]
exclude = [
".eggs",
".git",
".mypy_cache",
".venv",
"_build",
"build",
"dist",
]
# Assume Python 3.10+
target-version = "py310"
line-length = 100
indent-width = 4
[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)
]
extend-select = [
"F", # Pyflakes rules
"W", # PyCodeStyle warnings
"E", # PyCodeStyle errors
"I", # Sort imports properly
"A", # Detect shadowed builtins
"N", # enforce naming conventions, e.g. ClassName vs function_name
"UP", # Warn if certain things can changed due to newer Python versions
"C4", # Catch incorrect use of comprehensions, dict, list, etc
"FA", # Enforce from __future__ import annotations
"FBT", # detect boolean traps
"ISC", # Good use of string concatenation
"BLE", # disallow catch-all exceptions
"ICN", # Use common import conventions
"RET", # Good return practices
"SIM", # Common simplification rules
"TID", # Some good import practices
"TC", # Enforce importing certain types in a TYPE_CHECKING block
"PTH", # Use pathlib instead of os.path
"NPY", # Some numpy-specific things
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []