-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
316 lines (288 loc) · 8.94 KB
/
pyproject.toml
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
309
310
311
312
313
314
315
316
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
authors = [
{name = 'Daniele Arosio', email = '[email protected]'}
]
classifiers = [
"Environment :: Console",
"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 :: Unix Shell",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Development Status :: 3 - Alpha"
]
dependencies = [
'click <= 8.1.7',
'jpype1 <= 1.5.0',
'lxml <= 5.3.0',
'numpy <= 2.1.3',
'pims <= 0.7',
"setuptools",
"scyjava <= 1.10.0",
"bioio-bioformats <= 1.0.0",
"readlif <= 0.6.5",
"dask-image <= 2024.5.3",
"pyometiff <= 1.0.1"
]
description = "A project to read microscopy files."
keywords = [
"Bioimage",
"Image Analysis",
"Metadata",
"Open Microscopy",
"Tiled Images"
]
license = "BSD-3-Clause"
name = "nima_io"
readme = "README.md"
requires-python = ">=3.10, <3.13"
version = "0.3.12"
[project.optional-dependencies]
dev = [
"bfio <= 2.4.5",
"commitizen <= 3.30.1",
"ipykernel",
"jupyter",
"matplotlib <= 3.9.2",
"pre-commit <= 4.0.1",
"pylsp-mypy",
"ruff <= 0.7.3",
"ruff-lsp",
"scikit-image <= 0.24.0"
]
docs = [
"autodocsumm <= 0.2.14",
"nbsphinx <= 0.9.5",
"pydata-sphinx-theme <= 0.16.0",
"Sphinx <= 8.1.3",
"sphinx-click <= 6.0.0",
"sphinx_autodoc_typehints <= 2.5.0",
"sphinxcontrib-plantuml <= 0.30",
"xmltodict"
]
tests = [
"coverage[toml] <= 7.6.4",
"mypy <= 1.13.0",
"pygments <= 2.18.0", # color xdoctest
"pytest <= 8.3.3",
"types-click <= 7.1.8",
"xdoctest <= 1.2.0"
]
[project.scripts]
imgdiff = "nima_io.__main__:imgdiff"
[project.urls]
"Bug Tracker" = "https://github.com/darosio/nima_io/issues"
Changelog = "https://github.com/darosio/nima_io/blob/main/CHANGELOG.md"
# Discussions = "https://github.com/darosio/nima_io/discussions"
Documentation = "https://nima-io.readthedocs.io"
"Github releases" = "https://github.com/darosio/nima_io/releases"
Homepage = "https://github.com/darosio/nima_io"
[tool.codespell]
count = true
ignore-words-list = 'ciao'
quiet-level = 3
skip = 'examples/general_reading_and_development.ipynb,aics_et_al.ipynb'
[tool.commitizen]
name = "cz_customize"
tag_format = "v$version"
version = "0.3.12"
version_files = [
"pyproject.toml:version",
"docs/conf.py:release",
"README.md:Version",
"tests/test_cli.py:expected_version"
]
[tool.commitizen.customize]
bump_map = {"^.+!:" = "MAJOR", "BREAKING CHANGE" = "MAJOR", "feat" = "MINOR", "fix" = "PATCH", "perf" = "PATCH", "refactor" = "PATCH"}
bump_pattern = "^(BREAKING CHANGE|feat|fix|perf|refactor)"
change_type_map = {"feat" = "Feat", "fix" = "Fix", "docs" = "Docs", "build" = "Build", "style" = "Style", "refactor" = "Refactor", "perf" = "Perf", "test" = "Test", "ci" = "CI/CD"}
change_type_order = ["BREAKING CHANGE", "Feat", "Fix", "Docs", "Style", "Perf", "Test", "Build", "CI/CD"]
changelog_pattern = "^(feat|fix|docs|style|refactor|perf|test|build|ci)?(\\(.*\\))?(!)?"
commit_parser = "^(?P<change_type>feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\((?P<scope>[^()\r\n]*)\\)|\\()?(?P<breaking>!)?:\\s(?P<message>.*)?"
example = """fix(parser): correct minor typos in code\n
see the issue for details on the typos fixed\n
closes issue #12
"""
info_path = "cz_customize_info.txt"
message_template = "{{change_type}}:{% if show_message %} {{message}}{% endif %}"
schema = """
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
(BREAKING CHANGE: )<footer>
"""
schema_pattern = "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert|bump)(?:\\(([^()\r\n]*)\\)|\\()?(!)?:\\s(.*)?"
[[tool.commitizen.customize.questions]]
choices = [
{value = "feat", name = "feat: A new feature. Correlates with MINOR in SemVer"},
{value = "fix", name = "fix: A bug fix. Correlates with PATCH in SemVer"},
{value = "perf", name = "perf: A code change that improves performance. Correlates with PATCH in SemVer"},
{value = "docs", name = "docs: Documentation only changes"},
{value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)"},
{value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature"},
{value = "test", name = "test: Adding missing or correcting existing tests"},
{value = "build", name = "build: Changes that update the build system, development tools or external dependencies"},
{value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)"},
{value = "revert", name = "revert: Reverting to previous commit(s)."}
]
message = "Select the type of change you are committing"
name = "change_type"
type = "list"
[[tool.commitizen.customize.questions]]
message = "Body."
name = "message"
type = "input"
[[tool.commitizen.customize.questions]]
message = "Do you want to add body message in commit?"
name = "show_message"
type = "confirm"
[tool.coverage.paths]
source = ["src", "*/site-packages"]
tests = ["tests", "*/tests"]
[tool.coverage.report]
# fail_under = 100
exclude_lines = [
"pragma: no cover"
]
show_missing = true
[tool.coverage.run]
branch = true
omit = ["*__init__.py"]
source = ["nima_io", "tests"]
[tool.hatch.envs.default]
features = ["dev", "tests", "docs"]
[tool.hatch.envs.default.scripts]
bump = [
"cz bump --major-version-zero -ch {args}", # e.g. "--increment PATCH"
"hatch build",
"export TEST_PYPI_TOKEN=$(pass show cloud/test_pypi | head -n 1) && hatch publish -r test -u __token__ -a $TEST_PYPI_TOKEN"
]
ch = "cz ch --incremental --unreleased-version HEAD"
clean = "rm -rf ./build .coverage ./__pycache__ ./.mypy_cache ./.pytest_cache ./docs/_build ./tests/__pycache__ ./dist ./src/nima_io/__pycache__"
docs = "sphinx-build docs docs/_build"
docserve = "python -m http.server 8000 -d docs/_build"
init = [
"pre-commit --version",
"pre-commit install",
"pre-commit install --hook-type commit-msg --hook-type pre-push"
]
lint = [
"pre-commit --version",
"pre-commit run --all-files --show-diff-on-failure {args}"
]
[tool.hatch.envs.tests]
features = ["tests"]
template = "tests"
[[tool.hatch.envs.tests.matrix]]
python = ["3.12", "3.11", "3.10"] # reverse order to ensure the presence in older python of module included in newer versions
[tool.hatch.envs.tests.scripts]
all = ["test", "type", "xdoc", "cov"]
cov = [
"coverage combine",
"coverage report",
"coverage xml"
]
test = "coverage run -p -m pytest -v"
type = "mypy src tests docs/conf.py"
xdoc = "python -m xdoctest nima_io all"
[tool.isort]
combine_as_imports = true
force_single_line = false
include_trailing_comma = true
known_first_party = "nima_io"
line_length = 88 # to match black's default line length
multi_line_output = 3
profile = "black"
[tool.mypy]
# enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
enable_error_code = ["redundant-expr", "truthy-bool"]
plugins = ["numpy.typing.mypy_plugin"]
pretty = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict = true
warn_unreachable = true
warn_unused_configs = true
[tool.pydoclint]
check-class-attributes = false
[tool.pylsp-mypy]
dmypy = false
enabled = true
live_mode = true
strict = true
[tool.pytest.ini_options]
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
# xfail_strict = true
# filterwarnings = ["ignore::DeprecationWarning", "ignore:OVER"]
filterwarnings = ["ignore::DeprecationWarning"]
log_cli_level = "INFO"
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')"
]
minversion = "6.0"
testpaths = [
"tests"
]
[tool.ruff]
force-exclude = true
line-length = 88
target-version = "py312"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
ignore = ["ANN101", "ANN102", "ISC001"]
select = [
"A", # builtins
"ANN", # typing annotation
"ARG", # unused arguments
"B", # bugbear
"C",
"C4", # comprehensions
"C90", # mccabe
"D", # pydocstyle
"DTZ", # dates
"E", # pycodestyle
"TRY", # exceptions
"EM", # exceptions
"ERA", # eradicate
"F", # pyflakes
"FBT", # boolean-trap
"I", # isort
"ICN", # import conventions (opinionated)
"ISC", # implicit-str-concat
"N", # pep8-naming
"PD", # pandas-vet
"PGH", # pygrep WAIT
"PL", # pylint see PLR2004...
"PT", # pytest-style
"PTH", # use-pathlib
"Q", # quotes
"RUF", # Ruff
"S", # bandit XXX
"SIM", # simplify
"TID", # tidy-imports
"UP", # pyupgrade
"YTT", # 2020
"W" # pycodestyle
]
isort.combine-as-imports = true
isort.force-single-line = false
isort.known-first-party = ["nima_io"]
isort.split-on-trailing-comma = true
mccabe.max-complexity = 12
[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["ERA", "N816", "S314"]
"tests/*" = ["PLR2004", "S101"]
"tests/test_cli.py" = [
"S603" # Need to call a process as CliRunner and javabridge does not play well together
]
[tool.ruff.lint.pydocstyle]
convention = "numpy"