Skip to content

Commit 5511f7d

Browse files
authored
Migrate to pyproject.toml (PEP 518/621) (#165)
1 parent 4346ff5 commit 5511f7d

3 files changed

Lines changed: 95 additions & 80 deletions

File tree

.pre-commit-config.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ repos:
55
- id: check-docstring-first
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
8-
- repo: https://github.com/asottile/setup-cfg-fmt
9-
rev: v3.2.0
10-
hooks:
11-
- id: setup-cfg-fmt
128
- repo: https://github.com/astral-sh/ruff-pre-commit
139
rev: v0.14.10
1410
hooks:
@@ -17,6 +13,14 @@ repos:
1713
# Run the linter.
1814
- id: ruff-check
1915
args: [--fix,--unsafe-fixes]
16+
- repo: https://github.com/tox-dev/pyproject-fmt
17+
rev: v2.15.2
18+
hooks:
19+
- id: pyproject-fmt
20+
- repo: https://github.com/abravalheri/validate-pyproject
21+
rev: v0.25
22+
hooks:
23+
- id: validate-pyproject
2024
- repo: https://github.com/tlambert03/napari-plugin-checks
2125
rev: v0.3.0
2226
hooks:

pyproject.toml

Lines changed: 87 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,97 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "setuptools_scm"]
32
build-backend = "setuptools.build_meta"
3+
requires = [ "setuptools>=77", "setuptools-scm[toml]>=7", "wheel" ]
44

5-
[tool.ruff]
6-
lint.select = ["E", "F", "B", "I", "UP"]
7-
lint.ignore = ["E741"]
8-
target-version = "py310"
9-
fix = true
10-
line-length = 120
5+
[project]
6+
name = "napari-deeplabcut"
7+
description = "napari + DeepLabCut annotation tool"
8+
readme = { file = "README.md", content-type = "text/markdown" }
9+
license = "LGPL-3.0-only"
10+
license-files = [ "LICENSE" ]
11+
requires-python = ">=3.10"
12+
classifiers = [
13+
"Development Status :: 2 - Pre-Alpha",
14+
"Framework :: napari",
15+
"Intended Audience :: Developers",
16+
"Operating System :: OS Independent",
17+
"Programming Language :: Python :: 3 :: Only",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
22+
"Topic :: Scientific/Engineering :: Image Processing",
23+
"Topic :: Scientific/Engineering :: Visualization",
24+
]
25+
# Using setuptools-scm -> version is derived from git tags
26+
dynamic = [ "version" ]
27+
dependencies = [
28+
"dask-image",
29+
"matplotlib>=3.3",
30+
"napari==0.6.6",
31+
"natsort",
32+
"numpy>=1.18.5,<2",
33+
"opencv-python-headless",
34+
"pandas",
35+
"pyside6>=6.4.2",
36+
"pyyaml",
37+
"qtpy>=2.4",
38+
"scikit-image",
39+
"scipy",
40+
"tables",
41+
]
42+
[[project.authors]]
43+
name = "Team DeepLabCut, led by Jessy Lauer"
44+
email = "admin@deeplabcut.org"
45+
[project.entry-points."napari.manifest"]
46+
napari-deeplabcut = "napari_deeplabcut:napari.yaml"
47+
[project.optional-dependencies]
48+
testing = [
49+
"pillow",
50+
"pytest",
51+
"pytest-cov",
52+
"pytest-qt",
53+
"tox",
54+
]
55+
[project.urls]
56+
"Bug Tracker" = "https://github.com/DeepLabCut/napari-deeplabcut/issues"
57+
Documentation = "https://github.com/DeepLabCut/napari-deeplabcut#README.md"
58+
"Source Code" = "https://github.com/DeepLabCut/napari-deeplabcut"
59+
"User Support" = "https://github.com/DeepLabCut/napari-deeplabcut/issues"
1160

12-
[tool.uv]
13-
package = true
61+
# ----------------------------
62+
# setuptools configuration
63+
# ----------------------------
64+
[tool.setuptools]
65+
include-package-data = true
66+
[tool.setuptools.package-data]
67+
napari_deeplabcut = [ "napari.yaml" ]
68+
[tool.setuptools.package-dir]
69+
"" = "src"
70+
[tool.setuptools.packages.find]
71+
where = [ "src" ]
1472

1573
[tool.setuptools_scm]
1674
write_to = "src/napari_deeplabcut/_version.py"
1775

76+
[tool.uv]
77+
package = true
78+
79+
# ----------------------------
80+
# existing tool configuration
81+
# ----------------------------
82+
[tool.ruff]
83+
target-version = "py310"
84+
line-length = 120
85+
fix = true
86+
[tool.ruff.lint]
87+
select = [ "E", "F", "B", "I", "UP" ]
88+
ignore = [ "E741" ]
89+
90+
[tool.pyproject-fmt]
91+
max_supported_python = "3.12"
92+
generate_python_version_classifiers = true
93+
# Avoid collapsing tables to field.key = value format (less readable)
94+
table_format = "long"
95+
1896
[tool.pytest.ini_options]
1997
qt_api = "pyside6"

setup.cfg

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)