From a1f82e0cf85797e76fe47b7abb04d516ae32c914 Mon Sep 17 00:00:00 2001 From: Jash Parekh Date: Fri, 29 Sep 2023 14:32:26 +0530 Subject: [PATCH] Replace setup.py by a pyproject.toml (#478) --- pyproject.toml | 31 ++++++++++++++++++++++++++ setup.py | 33 ---------------------------- tests/python_on_whales/test_utils.py | 4 ---- 3 files changed, 31 insertions(+), 37 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py 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", - }, -) 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")