From 6a927b028209718c9db1bee8778b55a1d0a7b02d Mon Sep 17 00:00:00 2001 From: Johan Larsson Date: Tue, 29 Apr 2025 11:29:22 +0200 Subject: [PATCH 1/2] build: use pyproject.toml --- pyproject.toml | 25 +++++++++++++++++++++++++ requirements.txt | 4 ---- setup.cfg | 2 -- setup.py | 34 ---------------------------------- 4 files changed, 25 insertions(+), 40 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..c2bfa35 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,25 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "libsvmdata" +dynamic = ["version"] +description = "Fetcher for datasets" +authors = [{ name = "Mathurin Massias", email = "mathurin.massias@gmail.com" }] +maintainers = [ + { name = "Mathurin Massias", email = "mathurin.massias@gmail.com" }, +] +readme = "README.rst" +license = { text = "BSD (3-clause)" } +requires-python = ">=3.6" +dependencies = ["download", "numpy>=1.12", "scikit-learn", "scipy"] + +[project.urls] +"Download" = "https://github.com/mathurinm/libsvmdata.git" + +[tool.setuptools] +packages = ["libsvmdata"] + +[tool.flake8] +exclude = "__init__.py" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 8d7ec9f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -download -numpy -scikit-learn -scipy \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3521bb1..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -exclude = __init__.py \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 42a45b3..0000000 --- a/setup.py +++ /dev/null @@ -1,34 +0,0 @@ -import os -from setuptools.command.build_ext import build_ext -from setuptools import dist, setup, Extension, find_packages - -descr = 'Fetcher for datasets' - -version = None -with open(os.path.join('libsvmdata', '__init__.py'), 'r') as fid: - for line in (line.strip() for line in fid): - if line.startswith('__version__'): - version = line.split('=')[1].strip().strip('\'') - break -if version is None: - raise RuntimeError('Could not determine version') - -DISTNAME = 'libsvmdata' -DESCRIPTION = descr -MAINTAINER = 'Mathurin Massias' -MAINTAINER_EMAIL = 'mathurin.massias@gmail.com' -LICENSE = 'BSD (3-clause)' -DOWNLOAD_URL = 'https://github.com/mathurinm/libsvmdata.git' -VERSION = version - -setup(name='libsvmdata', - version=VERSION, - description=DESCRIPTION, - long_description=open('README.rst').read(), - license=LICENSE, - maintainer=MAINTAINER, - maintainer_email=MAINTAINER_EMAIL, - download_url=DOWNLOAD_URL, - install_requires=['download', 'numpy>=1.12', 'scikit-learn', 'scipy'], - packages=find_packages(), - ) From e0ff4986a24c065ad3e76e5b55f3ecc79113f1e2 Mon Sep 17 00:00:00 2001 From: Johan Larsson Date: Tue, 29 Apr 2025 14:06:12 +0200 Subject: [PATCH 2/2] fixup! build: use pyproject.toml --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c2bfa35..505afa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ dependencies = ["download", "numpy>=1.12", "scikit-learn", "scipy"] [tool.setuptools] packages = ["libsvmdata"] +dynamic = {version = {attr = "libsvmdata.__version__"}} [tool.flake8] exclude = "__init__.py"