forked from ivh/PyReduce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
220 lines (198 loc) · 5.59 KB
/
pyproject.toml
File metadata and controls
220 lines (198 loc) · 5.59 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
217
218
219
220
[project]
name = "pyreduce-astro"
version = "0.8.2"
requires-python = ">=3.12"
description = "A data reduction package for echelle spectrographs"
readme = "README.md"
authors = [
{name = "Nikolai Piskunov"},
{name = "Thomas Marquart"},
{name = "Ansgar Wehrhahn"}
]
maintainers = [
{name = "Thomas Marquart", email = "thomas.marquart@astro.uu.se"}
]
license = {text = "GPL-3.0-or-later"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: C",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Astronomy",
]
dependencies = [
"click>=8.1.0",
"cffi>=1.17.1",
"numpy>=1.26.0",
"matplotlib>=3.8.0",
"scipy>=1.11.0",
"astropy>=5.3.0",
"colorlog>=6.8.0",
"joblib>=1.3.0",
"jsonschema>=4.20.0",
"pyyaml>=6.0.0",
"pydantic>=2.5.0",
"spectres>=2.2.0",
"python-dateutil>=2.8.0",
"scikit-image>=0.22.0",
"tqdm>=4.66.0",
"Pillow>=10.0.0",
]
[project.optional-dependencies]
charslit = ["charslit>=0.1.0"]
[tool.uv.sources]
charslit = { git = "https://github.com/ivh/CharSlit" }
[dependency-groups]
dev = [
"ruff>=0.8.0",
"pre-commit>=3.5.0",
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
"sphinx>=7.2.0",
"ipython>=9.8.0",
"myst-parser",
"setuptools",
]
ipynb = [
"ipykernel>=7.1.0",
"jupyter-client>=8.8.0",
"jupytext>=1.18.1",
"nbconvert>=7.16.6",
]
[project.urls]
Homepage = "https://github.com/ivh/PyReduce"
Documentation = "https://pyreduce-astro.readthedocs.io"
Repository = "https://github.com/ivh/PyReduce"
Issues = "https://github.com/ivh/PyReduce/issues"
[project.scripts]
reduce = "pyreduce.__main__:main"
reduce-build = "pyreduce.clib.build_extract:build"
reduce-clean = "pyreduce.clib.build_extract:clean"
[build-system]
requires = ["hatchling>=1.25.0", "cffi>=1.17.1", "setuptools"]
build-backend = "hatchling.build"
[tool.hatch.build]
exclude = [
"/.git",
"/.github",
"/docs",
"/test",
"*.pyc",
"__pycache__",
]
# Include C source files and headers in the package
[tool.hatch.build.targets.wheel]
packages = ["pyreduce"]
include = [
"pyreduce/**/*.py",
"pyreduce/**/*.c",
"pyreduce/**/*.h",
"pyreduce/**/*.so", # Linux/macOS compiled extensions
"pyreduce/**/*.pyd", # Windows compiled extensions
"pyreduce/**/*.json",
"pyreduce/**/*.npz",
"pyreduce/**/*.sav",
]
artifacts = [
"pyreduce/clib/*.so", # Linux/macOS compiled extensions
"pyreduce/clib/*.pyd", # Windows compiled extensions
]
# Build CFFI extensions via build hook
[tool.hatch.build.hooks.custom]
path = "hatch_build.py"
# Ruff - Modern Python linter and formatter
[tool.ruff]
line-length = 88
target-version = "py312"
extend-exclude = [
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"_build",
"buck-out",
"build",
"dist",
".eggs",
"__pycache__",
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"E402", # module import not at top (legitimate cases in __init__.py, conf.py)
"E722", # bare except (many legacy cases, would require significant refactoring)
"UP031", # printf-style formatting (many cases in tools/ and examples/, low priority)
]
# Per-file ignores for specific cases
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports are intentional for re-exports
"docs/conf.py" = ["E402"] # imports after sys.path modification
"tools/**" = ["UP031", "B904"] # legacy tools, lower priority
"examples/**" = ["UP031"] # examples can use simpler syntax
[tool.ruff.lint.isort]
known-first-party = ["pyreduce"]
# pytest configuration
[tool.pytest.ini_options]
minversion = "7.0"
addopts = "-ra -q --strict-markers"
testpaths = ["test"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Fast unit tests with synthetic data (no downloads)",
"instrument: Integration tests using real instrument datasets",
"slow: Tests taking >5 seconds",
"downloads: Tests that download sample datasets",
]
filterwarnings = [
"ignore:The following header keyword is invalid:astropy.utils.exceptions.AstropyUserWarning",
"ignore:File may have been truncated:astropy.utils.exceptions.AstropyUserWarning",
"ignore::astropy.io.fits.verify.VerifyWarning",
]
# Coverage configuration
[tool.coverage.run]
source = ["pyreduce"]
omit = ["*/test/*", "*/test_*.py"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
# cibuildwheel configuration for building platform-specific wheels
[tool.cibuildwheel]
build = "cp312-* cp313-* cp314-*"
skip = "*-musllinux_* *-win32 *-manylinux_i686"
test-command = "pytest {project}/test -m unit"
test-requires = ["pytest"]
[tool.cibuildwheel.linux]
archs = ["x86_64"]
[tool.cibuildwheel.macos]
archs = ["arm64"]
[tool.cibuildwheel.windows]
archs = ["AMD64"]