-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
164 lines (143 loc) · 4.42 KB
/
pyproject.toml
File metadata and controls
164 lines (143 loc) · 4.42 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "turn_by_turn/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/doc",
"/tests",
]
[tool.hatch.build.targets.wheel]
packages = ["turn_by_turn"]
[project]
name = "turn_by_turn"
readme = "README.md"
description = "Read and write turn-by-turn measurement files from different particle accelerator formats."
authors = [
{name = "OMC Team", email = "pylhc@github.com"}, # see zenodo file / commits for details
]
license = "MIT"
dynamic = ["version"]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"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 :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
"Typing :: Typed",
]
dependencies = [
"numpy >= 1.24",
"scipy >= 1.5",
"pandas >= 2.1",
"sdds >= 0.4",
"h5py >= 2.9",
]
[project.optional-dependencies]
madng = [
"tfs-pandas >= 4.0.0", # for reading MAD-NG files (Could do everything in memory with just pandas)
]
xtrack = [
"xtrack >= 0.99.0", # for xtrack
"setuptools >= 65", # for xtrack
"xpart >= 0.23.8", # for xtrack
]
test = [
"pytest>=7.0",
"pytest-cov>=2.9",
"turn_by_turn[madng]",
"turn_by_turn[xtrack]",
]
doc = [
"sphinx >= 7.0",
"sphinx_rtd_theme >= 2.0",
"xtrack >= 0.99.0",
]
all = [
"turn_by_turn[test]",
"turn_by_turn[doc]",
"turn_by_turn[madng]",
"turn_by_turn[xtrack]",
]
[project.urls]
homepage = "https://github.com/pylhc/turn_by_turn"
repository = "https://github.com/pylhc/turn_by_turn"
documentation = "https://pylhc.github.io/turn_by_turn/"
# changelog = "https://github.com/pylhc/turn_by_turn/blob/master/CHANGELOG.md"
# ----- Tests Configuration ----- #
[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"--cov-report=term-missing",
"--cov-config=pyproject.toml",
"--cov=turn_by_turn",
]
testpaths = ["tests"]
# Helpful for pytest-debugging (leave commented out on commit):
# log_cli = true
# log_cli_level = "DEBUG"
# log_format = "%(levelname)7s | %(message)s | %(name)s"
[tool.coverage.run]
relative_files = true
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:", # do not count type checking 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 = []