forked from teamtomo/membrain-seg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
187 lines (166 loc) · 5.16 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
# https://peps.python.org/pep-0517/
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
# https://peps.python.org/pep-0621/
[project]
name = "membrain-seg"
description = "membrane segmentation in 3D for cryo-ET"
readme = "README.md"
requires-python = ">=3.8"
license = { text = "BSD 3-Clause License" }
authors = [
{ email = "[email protected]", name = "Lorenz Lamm" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = [
"monai",
"pytorch-lightning",
"torch",
"imageio",
"scipy",
"typer[all]",
"scikit-image",
"simpleitk",
"pandas",
"mrcfile",
]
# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
test = ["pytest>=6.0", "pytest-cov"]
dev = [
"black",
"ipython",
"pdbpp",
"pre-commit",
"pytest-cov",
"pytest",
"rich",
"ruff",
"mkdocs-material",
]
[project.urls]
homepage = "https://github.com/teamtomo/membrain-seg"
repository = "https://github.com/teamtomo/membrain-seg"
# same as console_scripts entry point
# [project.scripts]
# spam-cli = "spam:main_cli"
[project.scripts]
tomo_preprocessing = "membrain_seg.tomo_preprocessing:cli"
membrain = "membrain_seg.segmentation.cli:cli"
patch_corrections = "membrain_seg.annotations:cli"
# Entry points
# https://peps.python.org/pep-0621/#entry-points
# [project.entry-points."spam.magical"]
# tomatoes = "spam:main_tomatoes"
# https://hatch.pypa.io/latest/config/metadata/
[tool.hatch.version]
source = "vcs"
# https://hatch.pypa.io/latest/config/build/#file-selection
# [tool.hatch.build.targets.sdist]
# include = ["/src", "/tests"]
# [tool.hatch.build.targets.wheel]
# only-include = ["src"]
# sources = ["src"]
# https://github.com/charliermarsh/ruff
[tool.ruff]
line-length = 88
target-version = "py38"
# https://beta.ruff.rs/docs/rules/
extend-select = [
"E", # style errors
"W", # style warnings
"F", # flakes
"D", # pydocstyle
"I", # isort
"U", # pyupgrade
# "S", # bandit
"C", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"RUF", # ruff-specific rules
]
# I do this to get numpy-style docstrings AND retain
# D417 (Missing argument descriptions in the docstring)
# otherwise, see:
# https://beta.ruff.rs/docs/faq/#does-ruff-support-numpy-or-google-style-docstrings
# https://github.com/charliermarsh/ruff/issues/2606
extend-ignore = [
"D100", # Missing docstring in public module
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"D213", # Multi-line docstring summary should start at the second line
"D401", # First line should be in imperative mood
"D413", # Missing blank line after last section
"D416", # Section name should end with a colon
]
[tool.ruff.per-file-ignores]
"tests/*.py" = ["D", "S"]
"setup.py" = ["D"]
# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
minversion = "6.0"
testpaths = ["tests"]
filterwarnings = ["error"]
# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "src/**/"
strict = true
disallow_any_generics = false
disallow_subclassing_any = false
show_error_codes = true
pretty = true
# # module specific overrides
# [[tool.mypy.overrides]]
# module = ["numpy.*",]
# ignore_errors = true
# https://coverage.readthedocs.io/en/6.4/config.html
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
"except ImportError",
"\\.\\.\\.",
"raise NotImplementedError()",
]
[tool.coverage.run]
source = ["src"]
# https://github.com/mgedmin/check-manifest#configuration
[tool.check-manifest]
ignore = [
".github_changelog_generator",
".pre-commit-config.yaml",
".ruff_cache/**/*",
"setup.py",
"tests/**/*",
]
# https://python-semantic-release.readthedocs.io/en/latest/configuration.html
[tool.semantic_release]
version_source = "tag_only"
branch = "main"
changelog_sections = "feature,fix,breaking,documentation,performance,chore,:boom:,:sparkles:,:children_crossing:,:lipstick:,:iphone:,:egg:,:chart_with_upwards_trend:,:ambulance:,:lock:,:bug:,:zap:,:goal_net:,:alien:,:wheelchair:,:speech_balloon:,:mag:,:apple:,:penguin:,:checkered_flag:,:robot:,:green_apple:,Other"
# commit_parser=semantic_release.history.angular_parser
build_command = "pip install build && python -m build"
# # for things that require compilation
# # https://cibuildwheel.readthedocs.io/en/stable/options/
# [tool.cibuildwheel]
# # Skip 32-bit builds & PyPy wheels on all platforms
# skip = ["*-manylinux_i686", "*-musllinux_i686", "*-win32", "pp*"]
# test-extras = ["test"]
# test-command = "pytest {project}/tests -v"
# test-skip = "*-musllinux*"
# [tool.cibuildwheel.environment]
# HATCH_BUILD_HOOKS_ENABLE = "1"