forked from napari/bermuda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
173 lines (152 loc) · 4.66 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
[build-system]
requires = ["setuptools", "setuptools-rust", "setuptools-scm>=8.1"]
build-backend = "setuptools.build_meta"
[project]
name = "bermuda"
dynamic = [
"version",
]
description = "Spatial algorithms for napari project, compiled for performance"
readme = "README.md"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"numpy>=1.22.2",
]
[tool.setuptools_scm]
write_to = "python/bermuda/_version.py"
[tool.setuptools.packages]
# Pure Python packages/modules
find = { where = ["python"] }
[[tool.setuptools-rust.ext-modules]]
target="bermuda._bermuda"
path="crates/bermuda/Cargo.toml"
[dependency-groups]
test = [
"pytest>=8.3.4",
]
dev = [
"ipython>=8.18.1",
{include-group = "test"}
]
[tool.uv]
cache-keys = [{ file = "pyproject.toml" }, { file = "**/*.rs" }]
[tool.ruff]
line-length = 79
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".mypy_cache",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"*vendored*",
"*_vendor*",
]
fix = true
[tool.ruff.format]
quote-style = "single"
[tool.ruff.lint]
select = [
"E", "F", "W", #flake8
"UP", # pyupgrade
"I", # isort
"YTT", #flake8-2020
"TC", # flake8-type-checing
"BLE", # flake8-blind-exception
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"COM", # flake8-commas
"SIM", # flake8-simplify
"INP", # flake8-no-pep420
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"TID", # flake8-tidy-imports # replace absolutify import
"TRY", # tryceratops
"ICN", # flake8-import-conventions
"RUF", # ruff specyfic rules
"NPY201", # checks compatibility with numpy version 2.0
"ASYNC", # flake8-async
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"LOG", # flake8-logging
"SLOT", # flake8-slots
"PT", # flake8-pytest-style
"T20", # flake8-print
]
ignore = [
"E501", "TC001", "TC002", "TC003",
"A003", # flake8-builtins - we have class attributes violating these rule
"COM812", # flake8-commas - we don't like adding comma on single line of arguments
"COM819", # conflicts with ruff-format
"SIM117", # flake8-simplify - we some of merged with statements are not looking great with black, reanble after drop python 3.9
"RET504", # not fixed yet https://github.com/charliermarsh/ruff/issues/2950
"TRY003", # require implement multiple exception class
"RUF005", # problem with numpy compatybility, see https://github.com/charliermarsh/ruff/issues/2142#issuecomment-1451038741
"B028", # need to be fixed
"PYI015", # it produces bad looking files (@jni opinion)
"W191", "Q000", "Q001", "Q002", "Q003", "ISC001", # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["B011", "INP001", "TRY301", "B018", "RUF012"]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "single"
multiline-quotes = "double"
[tool.ruff.lint.flake8-tidy-imports]
# Disallow all relative imports.
ban-relative-imports = "all"
[tool.ruff.lint.isort]
known-first-party=['napari']
combine-as-imports = true
[tool.cibuildwheel]
test-command = "pytest {project}/tests"
test-groups = ["test"]
skip = "pp*macos* pp31* pp39-manylinux*"
build = "*64"
[tool.cibuildwheel.linux]
before-all = [
"curl https://sh.rustup.rs -sSf | sh -s -- -y",
"VERSION=$(grep '^channel' rust-toolchain.toml | cut -d '\"' -f2) && rustup toolchain install $VERSION && rustup override set $VERSION",
"rustup show"
]
environment = { PATH="$HOME/.cargo/bin:$PATH" }
[tool.cibuildwheel.macos]
environment = { MACOSX_DEPLOYMENT_TARGET="10.12"}
[[tool.cibuildwheel.overrides]]
select = "*-macosx*arm64"
environment = { MACOSX_DEPLOYMENT_TARGET="11.0"}
[[tool.cibuildwheel.overrides]]
select = "*cp31{2,3,4,5}*macosx*x86_64*"
environment = { MACOSX_DEPLOYMENT_TARGET="10.13"}