-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathpyproject.toml
More file actions
308 lines (268 loc) · 8.78 KB
/
Copy pathpyproject.toml
File metadata and controls
308 lines (268 loc) · 8.78 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
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
[project]
name = "stcal"
description = "STScI tools and algorithms used in calibration pipelines"
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "STScI" }]
classifiers = [
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"Programming Language :: Python :: 3",
]
dependencies = [
"astropy>=6.0.0",
"astropy_healpix>=1.1.2",
"drizzle>=2.2.0,<2.3.0",
"gwcs>=1.0.1,<2.0.0",
"numpy>=1.25.0",
"pyarrow>=10.0.1",
"requests>=2.22",
"scikit-image>=0.21.0",
"scipy>=1.14.1",
"shapely>=2.1.1",
"spherical-geometry>=1.3,<1.5",
"stsci.imagestats>=1.8.3,<1.9",
"tweakwcs>=0.9,<0.10",
]
license-files = ["LICENSE"]
dynamic = ["version"]
[project.optional-dependencies]
docs = [
"numpydoc",
"packaging >=17",
"sphinx",
"sphinx-astropy",
"sphinx-rtd-theme",
"tomli; python_version <=\"3.11\"",
]
test = ["asdf>=3.3.0", "pytest>=9.0", "pytest-doctestplus>=1.3.0"]
[project.urls]
repository = "https://github.com/spacetelescope/stcal"
tracker = "https://github.com/spacetelescope/stcal/issues"
[build-system]
requires = [
"Cython>=0.29.21",
"numpy>=2.0.0",
"setuptools>=61",
"setuptools_scm[toml]>=3.4",
]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
write_to = "src/stcal/_version.py"
[tool.setuptools]
zip-safe = true
[tool.setuptools.packages.find]
where = ["src"]
[tool.pytest]
minversion = "9.0"
log_cli_level = "INFO"
xfail_strict = true
doctest_plus = "enabled"
doctest_rst = "enabled"
text_file_format = "rst"
addopts = [
"--color=yes",
"--doctest-rst",
"-ra",
"--strict-config",
"--strict-markers",
]
testpaths = ["tests", "src/stcal", "docs"]
norecursedirs = ["benchmarks", ".asv", ".eggs", ".tox", "build", "venv"]
filterwarnings = [
"error::ResourceWarning",
# Files left open by tests can trigger ResourceWarnings during test
# teardown which otherwise would be converted back into a warning
# by pytest. Turn these PytestUnraisableExceptionWarnings back
# into errors
"error::pytest.PytestUnraisableExceptionWarning",
]
markers = ["soctests"]
[tool.ruff]
line-length = 110
src = ["src", "tests", "docs"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
[tool.ruff.lint]
select = [
"F", # Pyflakes (part of default flake8)
"E", # pycodestyle (part of default flake8)
"W", # pycodestyle (part of default flake8)
"D", # pydocstyle (docstring style guide)
"N", # pep8-naming
"A", # flake8-builtins (prevent shadowing of builtins)
"ARG", # flake8-unused-arguments (prevent unused arguments)
"B", # flake8-bugbear (prevent common gotcha bugs)
"C4", # flake8-comprehensions (best practices for comprehensions)
"I", # isort (import sorting)
"ICN", # flake8-import-conventions (enforce import conventions)
"INP", # flake8-no-pep420 (prevent use of PEP420, i.e. implicit name spaces)
"ISC", # flake8-implicit-str-concat (prevent implicit string concat)
"LOG", # flake8-logging
"NPY", # NumPy-specific checks (recommendations from NumPy)
"PGH", # pygrep (simple grep checks)
"PTH", # flake8-use-pathlib (prefer pathlib over os.path)
"S", # flake8-bandit (security checks)
"SLF", # flake8-self (prevent private member access)
"SLOT", # flake8-slots (require __slots__ for immutable classes)
"T20", # flake8-print (prevent print statements in code)
"TRY", # tryceratops (linting for try/except blocks)
"UP", # pyupgrade (upgrade code to modern python)
"YTT", # flake8-2020 (system version info)
"TID", # flake8-tidy-imports (prevent banned api and best import practices)
# below checks are not shared with jwst
"ANN", # flake8-annotations (best practices for type annotations)
"BLE", # flake8-blind-except (prevent blind except statements)
"T10", # flake8-debugger (prevent debugger statements in code)
"FA", # flake8-future-annotations (correct usage future annotations)
"RSE", # flake8-raise (best practices for raising exceptions)
"TCH", # flake8-type-checking (move type checking imports into type checking blocks)
"INT", # flake8-gettext (when to use printf style strings)
"FLY", # flynt (f-string conversion where possible)
]
ignore = [
"D100", # missing docstring in public module
"D105", # missing docstring in magic method
"E741", # ambiguous variable name (O/0, l/I, etc.)
"UP015", # unnecessary open(file, "r"). no harm being explicit
"TRY003", # prevents custom exception messages not defined in exception itself.
"TRY400", # enforces log.exception instead of log.error in except clause.
# below ignores are not shared with jwst
"ISC001", # interferes with formatter
"PLR0912", # Too many branches
"PLR0913", # Too many arguments
"PLR0915", # Too many statements
"PLR2004", # Magic value used in comparison
]
exclude = ["docs", "build", "dist", ".tox", ".eggs", "__init__.py"]
[tool.ruff.lint.extend-per-file-ignores]
"tests/*.py" = [
"E", # pycodestyle (part of default flake8)
"W", # pycodestyle (part of default flake8)
"D", # docstrings, see also numpydoc pre-commit action
"N", # pep8-naming (naming conventions)
"A", # flake8-builtins (prevent shadowing of builtins)
"ARG", # flake8-unused-arguments (prevent unused arguments)
"B", # flake8-bugbear (miscellaneous best practices to avoid bugs)
"C4", # flake8-comprehensions (best practices for comprehensions)
"F841", # Local variable `result` is assigned to but never used
"ICN", # flake8-import-conventions (enforce import conventions)
"INP", # flake8-no-pep420 (prevent use of PEP420, i.e. implicit name spaces)
"ISC", # flake8-implicit-str-concat (conventions for concatenating long strings)
"LOG", # flake8-logging
"NPY", # numpy-specific rules
"PGH", # pygrep-hooks (ensure appropriate usage of noqa and type-ignore)
"PTH", # flake8-use-pathlib (enforce using Pathlib instead of os)
"S", # flake8-bandit (security checks)
"SLF", # flake8-self (prevent using private class members outside class)
"SLOT", # flake8-slots (require __slots__ for immutable classes)
"TRY", # tryceratops (best practices for try/except blocks)
"UP", # pyupgrade (simplified syntax allowed by newer Python versions)
"YTT", # flake8-2020 (prevent some specific gotchas from sys.version)
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.flake8-annotations]
ignore-fully-untyped = true # Turn of annotation checking for fully untyped code
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
[[tool.mypy.overrides]]
module = [
"astropy.*",
"gwcs.*",
"tweakwcs.*",
"asdf.*",
"scipy.*",
"drizzle.*",
"stsci.imagestats.*",
"spherical_geometry.*",
# don't complain about the installed c parts of this library
"stcal.ramp_fitting.ols_cas22._fit",
"stcal.ramp_fitting.ols_cas22._jump",
"stcal.ramp_fitting.slope_fitter",
]
ignore_missing_imports = true
[tool.cython-lint]
max-line-length = 110
[tool.isort]
profile = "black"
filter_files = true
line_length = 110
[tool.codespell]
skip = "*.pdf,*.fits,*.asdf,.tox,build,./tags,.git,docs/_build"
ignore-words-list = "nd, ans, LIK, indx, usig, dne"
[tool.cibuildwheel]
# Disable free-threading builds on all platforms
skip = "cp3??t-*"
[tool.cibuildwheel.macos]
archs = ["x86_64", "arm64"]
[tool.cibuildwheel.linux]
archs = ["auto", "aarch64"]
[tool.coverage.run]
omit = ["config.py", "config-3.py", "*.rmap"]
[tool.towncrier]
filename = "CHANGES.rst"
directory = "changes"
package = "stcal"
title_format = "{version} ({project_date})"
ignore = [".gitkeep"]
wrap = true
issue_format = "`#{issue} <https://github.com/spacetelescope/stcal/issues/{issue}>`_"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
# step changes
[[tool.towncrier.type]]
directory = "alignment"
name = "alignment step"
showcontent = true
[[tool.towncrier.type]]
directory = "dark_current"
name = "dark_current step"
showcontent = true
[[tool.towncrier.type]]
directory = "jump"
name = "jump step"
showcontent = true
[[tool.towncrier.type]]
directory = "linearity"
name = "linearity step"
showcontent = true
[[tool.towncrier.type]]
directory = "outlier_detection"
name = "outlier_detection step"
showcontent = true
[[tool.towncrier.type]]
directory = "ramp_fitting"
name = "ramp_fitting step"
showcontent = true
[[tool.towncrier.type]]
directory = "resample"
name = "resample step"
showcontent = true
[[tool.towncrier.type]]
directory = "saturation"
name = "saturation step"
showcontent = true
[[tool.towncrier.type]]
directory = "skymatch"
name = "skymatch step"
showcontent = true
[[tool.towncrier.type]]
directory = "tweakreg"
name = "tweakreg step"
showcontent = true
# other changes
[[tool.towncrier.type]]
directory = "docs"
name = "Documentation Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "other"
name = "Other Changes"
showcontent = true