From 750034c22092ea9f2cae835f27cc4db823eccc34 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 30 Aug 2024 13:45:53 +0200 Subject: [PATCH] Use pyproject.toml to install build dependencies and specify metadata --- pyproject.toml | 44 ++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 3 --- setup.py | 41 +---------------------------------------- 3 files changed, 45 insertions(+), 43 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..15029248 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[build-system] +requires = [ + "numpy", + "setuptools", + "scipy", + "pytest-runner" +] +build-backend = "setuptools.build_meta" + + +[project] +name = "scikit-network" +version = "0.33.1" +dependencies = ['numpy>=1.22.4', 'scipy>=1.7.3'] +authors = [{name = "Scikit-network team"}] +maintainers = [{name = "Thomas Bonald", email = "bonald@enst.fr"}] +description = "Graph algorithms" +readme = "README.rst" +license = {text = "BSD License"} +keywords = ["sknetwork"] +classifiers=[ + 'Development Status :: 3 - Alpha', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: Education', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Natural Language :: English', + 'Programming Language :: Cython', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12' +] +requires-python = ">= 3.9" + +[project.optional-dependencies] +test = ["pytest", "note", "pluggy>=0.7.1"] + +[project.urls] +Repository = "https://github.com/sknetwork-team/scikit-network" +Documentation = "https://scikit-network.readthedocs.io/" +Changelog = "https://github.com/sknetwork-team/scikit-network/blob/master/HISTORY.rst" + diff --git a/setup.cfg b/setup.cfg index 8974b58c..e8afeeda 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,6 +19,3 @@ test = pytest [tool:pytest] collect_ignore = ['setup.py'] - -[options] -python_requires = >=3.9 diff --git a/setup.py b/setup.py index dd414548..8dcdc305 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- """Setup script.""" +import numpy from setuptools import find_packages, setup, Extension from sysconfig import get_platform @@ -10,18 +11,6 @@ import builtins from glob import glob -import numpy - -with open('README.rst') as readme_file: - readme = readme_file.read() - -with open('HISTORY.rst') as history_file: - history = history_file.read() - -requirements = ['numpy>=1.22.4', 'scipy>=1.7.3'] - -setup_requirements = ['pytest-runner'] - test_requirements = ['pytest', 'nose', 'pluggy>=0.7.1'] # if any problems occur with macOS' clang not knowing the -fopenmp flag, see: @@ -75,7 +64,6 @@ def finalize_options(self): build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process: builtins.__NUMPY_SETUP__ = False - import numpy self.include_dirs.append(numpy.get_include()) @@ -124,36 +112,9 @@ def finalize_options(self): setup( - author="Scikit-network team", - author_email='bonald@enst.fr', - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Intended Audience :: Information Technology', - 'Intended Audience :: Education', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Natural Language :: English', - 'Programming Language :: Cython', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12' - ], - description="Graph algorithms", - install_requires=requirements, - license="BSD license", - long_description=readme + '\n\n' + history, - long_description_content_type='text/x-rst', - include_package_data=True, - keywords='sknetwork', - name='scikit-network', packages=find_packages(), - setup_requires=setup_requirements, test_suite='tests', tests_require=test_requirements, - url='https://github.com/sknetwork-team/scikit-network', - version='0.32.1', zip_safe=False, ext_modules=ext_modules, include_dirs=[numpy.get_include()],