From 639661b3a7361653b77874c75db1d59372ef955e Mon Sep 17 00:00:00 2001 From: ThibaultFy Date: Mon, 25 Mar 2024 14:45:36 +0100 Subject: [PATCH] chore: depreciate setup.py in favour of pyproject.toml Signed-off-by: ThibaultFy --- pyproject.toml | 19 ++++++--------- setup.cfg | 5 ---- setup.py | 66 -------------------------------------------------- 3 files changed, 8 insertions(+), 82 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index c5f10009..cfcfdd21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,20 +1,16 @@ - [build-system] -requires = ["setuptools>=61.0.0"] - -[tool.setuptools] -include-package-data = true +requires = ["hatchling"] +build-backend = "hatchling.build" -[tool.setuptools.packages.find] +[tool.hatch.build.targets.sdist] exclude = ["tests*"] -[tool.setuptools.dynamic] -version = { attr = "substra.__version__" } +[tool.hatch.version] +path = "substra/__version__.py" [project] name = "substra" description = "Low-level Python library for interacting with a Substra network" -python_requires = ">=3.9" dependencies = [ "requests", "urllib3<2", @@ -26,7 +22,6 @@ dependencies = [ ] keywords = ["substra"] classifiers = [ - "License :: Apache 2.0", "Intended Audience :: Developers", "Topic :: Utilities", "Natural Language :: English", @@ -37,7 +32,9 @@ classifiers = [ ] license = { file = "LICENSE" } authors = [{ name = "Owkin, Inc." }] -dynamic = "version" +dynamic = ["version"] +requires-python = ">= 3.9" + [project.optional-dependencies] dev = [ diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d442ff91..00000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[aliases] -test=pytest - -[tool:pytest] -addopts = -v --cov=substra --ignore=tests/unit --ignore=tests/e2e diff --git a/setup.py b/setup.py deleted file mode 100644 index 9362aaa8..00000000 --- a/setup.py +++ /dev/null @@ -1,66 +0,0 @@ -"""Packaging settings.""" - -import os -from codecs import open - -from setuptools import find_packages -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) - - -with open(os.path.join(here, "README.md"), "r", "utf-8") as fp: - readme = fp.read() - - -about = {} -with open(os.path.join(here, "substra", "__version__.py"), "r", "utf-8") as fp: - exec(fp.read(), about) - - -setup( - name="substra", - version=about["__version__"], - description="Low-level Python library for interacting with a Substra network", - long_description=readme, - long_description_content_type="text/markdown", - url="https://docs.substra.org", - author="Owkin, Inc.", - license="Apache 2.0", - classifiers=[ - "Intended Audience :: Developers", - "Topic :: Utilities", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - ], - keywords=["cli", "substra"], - packages=find_packages(exclude=["tests*"]), - include_package_data=True, - install_requires=[ - "requests", - "urllib3<2", - "docker", - "pyyaml", - "pydantic>=2.3.0,<3.0.0", - "tqdm", - "python-slugify", - ], - python_requires=">=3.9", - extras_require={ - "dev": [ - "pandas", - "pytest", - "pytest-cov", - "pytest-mock", - "substratools>=0.21.2", - "black", - "flake8", - "isort", - "docstring_parser", - ], - }, - zip_safe=False, -)