-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
269 lines (233 loc) · 7.28 KB
/
pyproject.toml
File metadata and controls
269 lines (233 loc) · 7.28 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
#########################
# build-system settings #
#########################
[build-system]
requires = [
"pybind11",
"scikit-build-core>=0.10",
]
build-backend = "scikit_build_core.build"
####################
# project settings #
####################
[project]
name = "lsmtool"
dynamic = ["version"]
description = "The LOFAR Local Sky Model Tool"
readme = "README.md"
requires-python = ">=3.10.12"
authors = [
{ name = "David Rafferty", email = "drafferty@hs.uni-hamburg.de" },
]
maintainers = [
{ name = "Marcel Loose", email = "loose@astron.nl" },
{ name = "Hannes Breytenbach", email = "hannes.breytenbach@skao.int" },
]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Natural Language :: English",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"astropy >= 3.2",
"everybeam >= 0.6.1",
"lofar-parameterset >= 1.1",
"matplotlib",
"mocpy",
"numpy",
"python-casacore",
"pyvo",
"scipy >= 0.11",
"shapely",
"Pillow > 11.1",
"bdsf",
]
[project.optional-dependencies]
sofia = ["sofia2 @ git+https://gitlab.com/SoFiA-Admin/SoFiA-2.git@b10ab4ef"]
docs = [
"setuptools_scm",
"sphinx>=7.1",
"sphinx-rtd-theme>=0.4.3"
]
tests = [
"pytest",
"pytest-cov",
"pytest-mock",
"pytest-xdist",
"pytest-socket"
]
dev = [
"ruff",
"lsmtool[docs,tests,sofia]"
]
[dependency-groups]
sofia = ["lsmtool[sofia]"]
docs = ["lsmtool[docs]"]
tests = ["lsmtool[tests]"]
dev = ["lsmtool[dev]"]
[project.scripts]
lsmtool = "lsmtool.lsmtool:main"
correct_gaussian_orientation = "lsmtool.correct_gaussian_orientation:main"
convert_oskar_skymodel = "lsmtool.convert_oskar_skymodel:main"
[project.urls]
Documentation = "https://lsmtool.readthedocs.io/en/latest/"
Repository = "https://git.astron.nl/RD/LSMTool"
#########################
# cibuildwheel settings #
#########################
# NOTE: running cibuildwheel only makes sense when `BUILD_EXTENSIONS` in
# section `[tool.scikit-build.cmake.define]` is set to "ON" or "TRUE".
[tool.cibuildwheel]
build = "cp3{10,11,12,13}-*_x86_64"
build-verbosity = 1
test-command = "cd {package} && pytest"
test-requires = "pytest"
[tool.cibuildwheel.linux]
skip = ["*-musllinux_*"]
#########################
# scikit-build settings #
#########################
[tool.scikit-build]
cmake.version = ">=3.15"
ninja.version = ">=1.5"
build.verbose = true
logging.level = "INFO"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
sdist.include = ["lsmtool/_version.py"]
[tool.scikit-build.cmake.define]
BUILD_EXTENSIONS = "OFF"
###########################
# setuptools_scm settings #
###########################
[tool.setuptools_scm]
write_to = "lsmtool/_version.py"
###########################
# ruff settings #
###########################
# Copied from https://git.astron.nl/templates/python-package/-/blob/9ccee1fed6796b6784e8814cc83ee4e5d34bba3d/%7B%7Bcookiecutter.project_slug%7D%7D/pyproject.toml
[tool.ruff]
line-length = 80
exclude = [
".venv",
".git",
".tox",
"dist",
"docs",
"*lib/python*",
"*egg",
"_version.py",
"__pycache__",
"lsmtool/_logging.py",
"lsmtool/lsmtool.py",
"lsmtool/operations",
"lsmtool/operations_lib.py",
"lsmtool/skymodel.py",
"lsmtool/tableio.py",
"lsmtool/_version.py",
"lsmtool/_changelog.py",
"tests/test_lsmtool.py",
"tests/test_operations_lib.py",
]
[tool.ruff.lint]
# Expand basic rules with name and style checks roughly equivalent to flake8 + black + pylint
# Some additional functional errors such as `await` on none async or wrong return types / args.
# More info https://docs.astral.sh/ruff/rules/
select = ["N", "A", "E", "F", "B", "W", "Q", "PL", "ASYNC", "S", "G", "RET", "ARG", "I"]
# ignore:
# PLR2004: magic-value-comparison
# N803: pep8-naming (lsmtool mostly uses pascalCase and CamelCase naming scheme)
ignore = ["PLR2004", "N803"]
[tool.ruff.lint.per-file-ignores]
"lsmtool/filter_skymodel/*.py" = ["PLR0913"] # Too many arguments in function definition
"lsmtool/testing.py" = ["PLR0911"] # Too many return statements
"tests/*.py" = [
"S101", # Use of `assert` detected
"S108", # Probable insecure usage of temporary file or directory
"PLR0913" # Too many arguments in function definition
]
###########################
# coverage settings #
###########################
[tool.coverage.run]
omit = ["lsmtool/_changelog.py", "lsmtool/_version.py"]
[tool.coverage.report]
sort = "cover"
###########################
# tox settings #
###########################
# Adapted from: https://git.astron.nl/templates/python-package/-/blob/9ccee1fed6796b6784e8814cc83ee4e5d34bba3d/%7B%7Bcookiecutter.project_slug%7D%7D/pyproject.toml
[tool.tox]
# Generative environment list to test all supported Python versions
requires = ["tox>=4.21"]
env_list = ["fix", "coverage", "lint", "format", "py{10,11,12,13}"]
[tool.tox.env_run_base]
description = "run unit tests"
deps = [{ replace = "ref", of = ["dependency-groups", "tests"], extend = true }]
extras = ["tests"]
package = "editable"
set_env = { LANGUAGE = "en_US", LC_ALL = "en_US.UTF-8", PYTHONWARNINGS = "default::DeprecationWarning", PYTEST_XDIST_AUTO_NUM_WORKERS = "4" }
commands = [
["python", "--version"],
["python", "-m", "pytest", "-vv", "-n", "auto", { replace = "posargs", default = [], extend = true }]
]
# [tool.tox.env.fix]
# description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
# skip_install = true
# deps = ["pre-commit-uv>=4.1.1"]
# commands = [["pre-commit", "run", "--all-files", "--show-diff-on-failure"]]
[tool.tox.env.coverage]
extras = ["tests"]
commands = [
["python", "--version"],
[
"python", "-m", "pytest",
{ replace = "posargs", default = [], extend = true },
"--cov=lsmtool",
"--cov-report", "term",
"--cov-report", "xml",
"--cov-report", "html"
]
]
# Command prefixes to reuse the same virtualenv for all linting jobs.
[tool.tox.env.lint]
deps = ["ruff"]
commands = [
["python", "-m", "ruff", "--version"],
["python", "-m", "ruff", "format", "--check"],
["python", "-m", "ruff", "check",
{ replace = "posargs", default = [], extend = true }]
]
[tool.tox.env.format]
deps = ["ruff"]
commands = [
["python", "-m", "ruff", "format",
{ replace = "posargs", default = [], extend = true }],
["python", "-m", "ruff", "check", "--select", "I", "--fix"]
]
[tool.tox.env.docs]
deps = [{ replace = "ref", of = ["dependency-groups", "docs"], extend = true }]
extras = ["docs"]
# unset LC_ALL / LANGUAGE from testenv, would fail sphinx otherwise
set_env = ""
changedir = "{tox_root}"
allowlist_externals = ["rm"]
commands = [
["rm", "-rf", "docs/build/html"],
["python", "-m", "sphinx.cmd.build", "docs/source", "docs/build/html"]
]
[tool.tox.env.build]
package = "skip"
deps = ["build>=0.8.0"]
commands = [["python", "-m", "build", "--sdist"]]
[tool.tox.env.deploy]
package = "skip"
deps = ["build>=0.8.0", "twine"]
pass_env = ["TWINE_*"]
commands = [
["python", "-m", "build", "--sdist"],
["python", "-m", "twine", "upload", "--verbose", "dist/*"]
]