Repository: gabrieldemarmiesse/python-on-whales (language: python)

Issue:
Replace setup.py by a pyproject.toml
There is no reason to not follow the latest packaging standards. This shouldn't be too difficult


Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..9778abf2
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,31 @@
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "python-on-whales"
+version = "0.64.3"
+description = "A Docker client for Python, designed to be fun and intuitive!"
+readme = "README.md"
+license = { file = "LICENSE" }
+requires-python = ">=3.8, <4"
+dynamic = ["dependencies"]
+
+[tool.setuptools.dynamic]
+dependencies = { file = ["requirements.txt"] }
+
+[project.optional-dependencies]
+test = [
+  "pytest",
+]
+
+[project.urls]
+"Source" = "https://github.com/gabrieldemarmiesse/python-on-whales"
+"Documentation" = "https://gabrieldemarmiesse.github.io/python-on-whales/"
+"Bug Tracker" = "https://github.com/gabrieldemarmiesse/python-on-whales/issues"
+
+[project.scripts]
+python-on-whales = "python_on_whales.command_line_entrypoint:main"
+
+[tool.setuptools.packages.find]
+exclude = ["tests", "docs"]
diff --git a/setup.py b/setup.py
deleted file mode 100644
index d001b5f6..00000000
--- a/setup.py
+++ /dev/null
@@ -1,33 +0,0 @@
-from pathlib import Path
-
-from setuptools import find_packages, setup
-
-CURRENT_DIR = Path(__file__).parent
-
-
-def get_long_description() -> str:
-    return (CURRENT_DIR / "README.md").read_text(encoding="utf8")
-
-
-setup(
-    name="python-on-whales",
-    version="0.64.3",
-    description="A Docker client for Python, designed to be fun and intuitive!",
-    long_description=get_long_description(),
-    long_description_content_type="text/markdown",
-    install_requires=(CURRENT_DIR / "requirements.txt").read_text().splitlines(),
-    packages=find_packages(),
-    include_package_data=True,  # will read the MANIFEST.in
-    license="MIT",
-    python_requires=">=3.8, <4",
-    entry_points={
-        "console_scripts": [
-            "python-on-whales=python_on_whales.command_line_entrypoint:main"
-        ],
-    },
-    project_urls={
-        "Documentation": "https://gabrieldemarmiesse.github.io/python-on-whales/",
-        "Source Code": "https://github.com/gabrieldemarmiesse/python-on-whales",
-        "Bug Tracker": "https://github.com/gabrieldemarmiesse/python-on-whales/issues",
-    },
-)


Test patch:
diff --git a/tests/python_on_whales/test_utils.py b/tests/python_on_whales/test_utils.py
index 02768b03..b04d668d 100644
--- a/tests/python_on_whales/test_utils.py
+++ b/tests/python_on_whales/test_utils.py
@@ -1,10 +1,6 @@
 import python_on_whales.utils
 
 
-def test_project_root():
-    assert (python_on_whales.utils.PROJECT_ROOT / "setup.py").exists()
-
-
 def test_environment_variables_propagation(monkeypatch):
     monkeypatch.setenv("SOME_VARIABLE", "dododada")