diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 77f27c91..ea9d503c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,10 +5,6 @@ repos: - id: check-docstring-first - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/asottile/setup-cfg-fmt - rev: v3.2.0 - hooks: - - id: setup-cfg-fmt - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.10 hooks: @@ -17,6 +13,14 @@ repos: # Run the linter. - id: ruff-check args: [--fix,--unsafe-fixes] + - repo: https://github.com/tox-dev/pyproject-fmt + rev: v2.15.2 + hooks: + - id: pyproject-fmt + - repo: https://github.com/abravalheri/validate-pyproject + rev: v0.25 + hooks: + - id: validate-pyproject - repo: https://github.com/tlambert03/napari-plugin-checks rev: v0.3.0 hooks: diff --git a/pyproject.toml b/pyproject.toml index 594660f9..afc982af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,19 +1,97 @@ [build-system] -requires = ["setuptools", "wheel", "setuptools_scm"] build-backend = "setuptools.build_meta" +requires = [ "setuptools>=77", "setuptools-scm[toml]>=7", "wheel" ] -[tool.ruff] -lint.select = ["E", "F", "B", "I", "UP"] -lint.ignore = ["E741"] -target-version = "py310" -fix = true -line-length = 120 +[project] +name = "napari-deeplabcut" +description = "napari + DeepLabCut annotation tool" +readme = { file = "README.md", content-type = "text/markdown" } +license = "LGPL-3.0-only" +license-files = [ "LICENSE" ] +requires-python = ">=3.10" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Framework :: napari", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Scientific/Engineering :: Image Processing", + "Topic :: Scientific/Engineering :: Visualization", +] +# Using setuptools-scm -> version is derived from git tags +dynamic = [ "version" ] +dependencies = [ + "dask-image", + "matplotlib>=3.3", + "napari==0.6.6", + "natsort", + "numpy>=1.18.5,<2", + "opencv-python-headless", + "pandas", + "pyside6>=6.4.2", + "pyyaml", + "qtpy>=2.4", + "scikit-image", + "scipy", + "tables", +] +[[project.authors]] +name = "Team DeepLabCut, led by Jessy Lauer" +email = "admin@deeplabcut.org" +[project.entry-points."napari.manifest"] +napari-deeplabcut = "napari_deeplabcut:napari.yaml" +[project.optional-dependencies] +testing = [ + "pillow", + "pytest", + "pytest-cov", + "pytest-qt", + "tox", +] +[project.urls] +"Bug Tracker" = "https://github.com/DeepLabCut/napari-deeplabcut/issues" +Documentation = "https://github.com/DeepLabCut/napari-deeplabcut#README.md" +"Source Code" = "https://github.com/DeepLabCut/napari-deeplabcut" +"User Support" = "https://github.com/DeepLabCut/napari-deeplabcut/issues" -[tool.uv] -package = true +# ---------------------------- +# setuptools configuration +# ---------------------------- +[tool.setuptools] +include-package-data = true +[tool.setuptools.package-data] +napari_deeplabcut = [ "napari.yaml" ] +[tool.setuptools.package-dir] +"" = "src" +[tool.setuptools.packages.find] +where = [ "src" ] [tool.setuptools_scm] write_to = "src/napari_deeplabcut/_version.py" +[tool.uv] +package = true + +# ---------------------------- +# existing tool configuration +# ---------------------------- +[tool.ruff] +target-version = "py310" +line-length = 120 +fix = true +[tool.ruff.lint] +select = [ "E", "F", "B", "I", "UP" ] +ignore = [ "E741" ] + +[tool.pyproject-fmt] +max_supported_python = "3.12" +generate_python_version_classifiers = true +# Avoid collapsing tables to field.key = value format (less readable) +table_format = "long" + [tool.pytest.ini_options] qt_api = "pyside6" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fe16cb09..00000000 --- a/setup.cfg +++ /dev/null @@ -1,67 +0,0 @@ -[metadata] -name = napari-deeplabcut -description = napari + DeepLabCut annotation tool -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/DeepLabCut/napari-deeplabcut -author = Team DeepLabCut, Lead by Jessy Lauer -author_email = admin@deeplabcut.org -license = LGPL-3.0 -license_files = LICENSE -classifiers = - Development Status :: 2 - Pre-Alpha - Framework :: napari - Intended Audience :: Developers - Operating System :: OS Independent - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Topic :: Scientific/Engineering :: Artificial Intelligence - Topic :: Scientific/Engineering :: Image Processing - Topic :: Scientific/Engineering :: Visualization -project_urls = - Bug Tracker = https://github.com/DeepLabCut/napari-deeplabcut/issues - Documentation = https://github.com/DeepLabCut/napari-deeplabcut#README.md - Source Code = https://github.com/DeepLabCut/napari-deeplabcut - User Support = https://github.com/DeepLabCut/napari-deeplabcut/issues - -[options] -packages = find: -install_requires = - dask-image - matplotlib>=3.3 - napari==0.6.6 - natsort - numpy>=1.18.5,<2.0.0 - opencv-python-headless - pandas - pyside6>=6.4.2 - pyyaml - qtpy>=2.4 - scikit-image - scipy - tables -python_requires = >=3.10 -include_package_data = True -package_dir = - =src -setup_requires = - setuptools-scm - -[options.packages.find] -where = src - -[options.entry_points] -napari.manifest = - napari-deeplabcut = napari_deeplabcut:napari.yaml - -[options.extras_require] -testing = - Pillow - pytest - pytest-cov - pytest-qt - tox - -[options.package_data] -napari_deeplabcut = - napari.yaml