Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
161 lines (143 loc) · 5.84 KB
/
Copy pathpyproject.toml
File metadata and controls
161 lines (143 loc) · 5.84 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
[tool.poetry]
name = "gertils"
version = "0.7.0"
description = "General computing utilities for data processing and analysis in the Gerlich group at IMBA"
authors = [
"Vince Reuter <vince.reuter@gmail.com>",
]
readme = "README.md"
license = "MIT"
repository = "https://github.com/gerlichlab/gertils"
classifiers = [
"Development Status :: 1 - Planning",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Utilities",
"Typing :: Typed",
]
include = ["py.typed"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
# These are the main runtime dependencies.
python = ">=3.11,<3.14"
dask = ">=2023.5.1"
numpy = ">=1.24.2,<3"
numpydoc_decorator = "^2.2.1"
zarr = "^2.4.12"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
# The dev group is for developers' convenience.
# Consider each new dependency to another group as a dev group candidate.
codespell = "^2.2.2"
hypothesis = "^6.68.2"
pre-commit = "^4.0"
pyright = "==1.1.411"
pytest = "^7.1.0"
pytest-cov = "^5.0.0"
ruff = "==0.7.4"
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
# Everything that the pre-commit hooks run, for the checks job in CI.
codespell = "^2.2.2"
hypothesis = "^6.68.2"
pre-commit = "^4.0"
# The version looptrace pins, so the projects are type-checked by the same pyright.
pyright = "==1.1.411"
pytest = "^7.1.0"
# The version looptrace pins, so the projects are formatted and linted by the same ruff.
ruff = "==0.7.4"
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
hypothesis = "^6.68.2"
pytest = "^7.1.0"
pytest-cov = "^5.0.0"
[tool.codespell]
skip = ".git,.vscode,__pycache__,pyproject.toml,poetry.lock"
builtin = "clear,rare,informal,usage,code,names"
ignore-words-list = "jupyter,iff" # prevent jupyter -> jupiter, iff -> if
check-filenames = true
uri-ignore-words-list = "*" # prevent spelling correction in URL-like values.
[tool.pyright]
include = ["gertils", "tests"]
# The package itself gets strict checking; the tests get the standard level.
strict = ["gertils"]
reportUnnecessaryTypeIgnoreComment = "error"
[tool.ruff]
# No line-length: ruff's default of 88, as in the other repositories behind looptrace.
target-version = "py311"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Missing members
"ANN10", # Deprecated: Missing type annotation for self/cls in (class)method
"D105", # Missing docstring in magic method
"ANN204", # Missing return type annotation for special method
# Opinionated syntax
"D203", # Ignore this to instead opt for class body or docstring to possibly start right away under class.
"D213", # Ignore this to instead opt for summary part of docstring to be on first physical line.
"TRY003", # Avoid specifying long messages outside the exception class
"C408", # Unnecessary `dict` call (rewrite as a literal)
"EM", # Exception must not use a (f-)string literal, assign to variable first
"FIX002", # Line contains TODO, consider resolving the issue
"D400", # First line should end with a period
"D415", # First line should end with a period, question mark, or exclamation point
"N818", # Exception should be named with an Error suffix
# Imports and type annotations
"FA100", # Missing `from __future__ import annotations`, but uses `typing.*`
"TCH002", # Move third-party import `...` into a type-checking block
"TCH003", # Move standard library import `...` into a type-checking block
"UP007", # Use `X | Y` for type annotations
# Ruff recommends avoiding these checks when using `ruff format`. Since
# `ruff format` is a drop-in replacement for `black`, we avoid the same
# checks here (https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
# has more details):
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"E501", # line-too-long
]
[tool.ruff.lint.pydocstyle]
# numpydoc_decorator's @doc writes the docstring of the functions it decorates when the
# module is imported, so ruff, which only reads the source, doesn't see one. The setting
# applies only to functions and methods, so classes keep their `# noqa: D101`.
ignore-decorators = ["numpydoc_decorator.doc"]
[tool.ruff.lint.per-file-ignores]
"typings/*" = [
# Stubs copy the signatures of third-party code, which we can't change.
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"PLR0913", # Too many arguments in function definition
]
"tests/*" = [
# Ignore some groups of checks in our test code.
"ANN", # Type annotations
"D10", # Missing docstrings
"TCH00", # Imports and type checking blocks
"INP001", # File `...` is part of an implicit namespace package. Add an `__init__.py`.
# Ignore some more specific checks in our test code.
"D401", # First line of docstring should be in imperative mood
"N802", # Function name `...` should be lowercase
"S101", # Use of `assert` detected
]