From fba5f5e68e3ef28c7d3db5d5fed110fa4df19544 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 29 Oct 2022 11:44:14 +0200 Subject: [PATCH] =?UTF-8?q?Migrate=20setup.py=20=E2=86=92=20pyproject.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See PEP 621 and PEP 518. Keep setup.py for legacy installs. The proper way to install is now: pip install --- pyproject.toml | 30 +++++++++++++++++++++++++++--- setup.py | 29 +++-------------------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4d3bb67..88dbae1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,29 @@ [build-system] -requires = [ - "setuptools", -] +requires = ["setuptools>=64.0.0", "setuptools-scm"] build-backend = "setuptools.build_meta" + + +[project] +name = "py-cpuinfo" +version = "9.0.0" +description = "Get CPU info with pure Python" +license = {text = "MIT"} +authors = [ + {name = "Matthew Brennan Jones", email = "matthew.brennan.jones@gmail.com"} +] +readme = "README.rst" +requires-python = ">=3" +classifiers=[ + "Development Status :: 5 - Production/Stable", + "Topic :: Utilities", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3" +] +packages=["cpuinfo"] + +[project.urls] +homepage = "https://github.com/workhorsy/py-cpuinfo" +repository = "https://github.com/workhorsy/py-cpuinfo.git" + +[project.scripts] +cpuinfo = "cpuinfo:main" diff --git a/setup.py b/setup.py index dbfb62f..c30c16e 100644 --- a/setup.py +++ b/setup.py @@ -1,33 +1,10 @@ +#!/usr/bin/env python # Copyright (c) 2014-2022 Matthew Brennan Jones # Py-cpuinfo gets CPU info with pure Python # It uses the MIT License # It is hosted at: https://github.com/workhorsy/py-cpuinfo -import os from setuptools import setup -with open(os.path.join(os.getcwd(), 'README.rst')) as f: - readme_content = f.read() - -setup( - name = "py-cpuinfo", - version = "9.0.0", - author = "Matthew Brennan Jones", - author_email = "matthew.brennan.jones@gmail.com", - description = "Get CPU info with pure Python", - long_description=readme_content, - python_requires='>=3', - license = "MIT", - url = "https://github.com/workhorsy/py-cpuinfo", - packages=['cpuinfo'], - test_suite="test_suite", - entry_points = { - 'console_scripts': ['cpuinfo = cpuinfo:main'], - }, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Topic :: Utilities", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3" - ], -) +if __name__ == "__main__": + setup()