From f50d90e90725644a7fa4c06b5fdbbc00644a49a5 Mon Sep 17 00:00:00 2001 From: AdenAthar Date: Fri, 24 Apr 2026 14:03:13 -0700 Subject: [PATCH] Replace setup.py with pyproject.toml (PEP 517/518) Migrates packaging, dependency pins, and tool configuration into a single pyproject.toml. pytest/pytest-cov/sphinx moved to dev extras. Adds [tool.pytest.ini_options] and [tool.coverage.*] so these no longer need to be passed as CLI flags. Co-Authored-By: Claude Sonnet 4.6 --- pyproject.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 28 ---------------------------- 2 files changed, 47 insertions(+), 28 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4d766dd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +requires = ["setuptools>=68", "wheel"] +build-backend = "setuptools.backends.legacy:build" + +[project] +name = "granny" +version = "1.0a1" +description = "GRANNY is a software package used to rate disorder severity in pome fruits." +authors = [ + { name = "Nhan H. Nguyen" }, + { name = "Heidi Hargarten" }, + { name = "Loren Honaas" }, + { name = "Stephen P. Ficklin" }, +] +license = { text = "GNU General Public License v3.0" } +requires-python = ">=3.9" +urls = { homepage = "https://github.com/SystemsGenetics/granny" } +dependencies = [ + "ultralytics>=8.0,<9.0", + "numpy>=1.24", + "opencv-python>=4.8", + "pandas>=2.0", + "pyzbar>=0.1.9", +] + +[project.optional-dependencies] +dev = [ + "pytest>=7.0", + "pytest-cov>=4.0", + "sphinx>=7.0", +] + +[project.scripts] +granny = "Granny.GrannyBase:run" + +[tool.setuptools.packages.find] +where = ["."] + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.coverage.run] +source = ["Granny"] +omit = ["tests/*", "venv/*"] + +[tool.coverage.report] +show_missing = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 959b5bf..0000000 --- a/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -import setuptools - -requirements = """ -ultralytics -numpy -opencv-python -pytest -""".split() - - -setuptools.setup( - name="granny", - packages=setuptools.find_packages(), - url="https://github.com/SystemsGenetics/granny", - version="1.0a1", - description="GRANNY is a software package used to rate disorder severity in pome fruits.", - author="Nhan H. Nguyen, Heidi Hargarten, Loren Honaas, Stephen P. Ficklin", - license="GNU General Public License v3.0", - python_requires=">=3.9", - install_requires=[ - requirements, - ], - entry_points={ - "console_scripts": [ - "granny = Granny.GrannyBase:run", - ] - }, -)