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 1/2] =?UTF-8?q?Migrate=20setup.py=20=E2=86=92=20pyproject.?= =?UTF-8?q?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() From 70785c75ab35086fbba7ce0b860ef71442cc8c36 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Sat, 29 Oct 2022 21:48:50 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Migrate=20setup.cfg=20=E2=86=92=20pyproject?= =?UTF-8?q?.toml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See PEP 621 and PEP 518. --- .github/workflows/python-test.yml | 2 +- pyproject.toml | 14 +++++++++----- setup.cfg | 2 -- 3 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index f3f6542..205d358 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -29,4 +29,4 @@ jobs: python -m pip install --upgrade pip - name: Run tests run: | - python setup.py test + python test_suite.py diff --git a/pyproject.toml b/pyproject.toml index 88dbae1..53e1745 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,7 @@ [build-system] -requires = ["setuptools>=64.0.0", "setuptools-scm"] +requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" - [project] name = "py-cpuinfo" version = "9.0.0" @@ -11,7 +10,7 @@ license = {text = "MIT"} authors = [ {name = "Matthew Brennan Jones", email = "matthew.brennan.jones@gmail.com"} ] -readme = "README.rst" +readme = "README.md" requires-python = ">=3" classifiers=[ "Development Status :: 5 - Production/Stable", @@ -22,8 +21,13 @@ classifiers=[ packages=["cpuinfo"] [project.urls] -homepage = "https://github.com/workhorsy/py-cpuinfo" -repository = "https://github.com/workhorsy/py-cpuinfo.git" +Homepage = "https://github.com/workhorsy/py-cpuinfo" +Repository = "https://github.com/workhorsy/py-cpuinfo.git" +Issues = "https://github.com/workhorsy/py-cpuinfo/issues" +Changelog = "https://github.com/workhorsy/py-cpuinfo/blob/master/ChangeLog" [project.scripts] cpuinfo = "cpuinfo:main" + +[tool.distutils.bdist_wheel] +universal = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 526aeb2..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 0