From 1e4da5ca2ddeed0fe9e28e6986cf6b090ca2510d Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Tue, 18 Oct 2022 21:28:26 +0300 Subject: [PATCH 1/2] Move the metadata into `setup.cfg` --- .github/workflows/run-tests.yml | 6 ++-- pyproject.toml | 5 +++ setup.cfg | 43 +++++++++++++++++++++++- setup.py | 59 --------------------------------- 4 files changed, 50 insertions(+), 63 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 735dac9e..02737b1b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -22,7 +22,7 @@ jobs: - name: Upgrade pip run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools build - name: Install dependencies run: | @@ -43,9 +43,9 @@ jobs: if: matrix.python-version != '2.7' && matrix.python-version != 'pypy2' run: | python -m pip install coveralls==3.1.0 - python -m pip install . + python -m build -nwx . + python -m pip install --upgrade ./dist/*.whl python -m flake8 sh.py test.py - python setup.py check --restructuredtext --metadata --strict SH_TESTS_RUNNING=1 SH_TESTS_USE_SELECT=0 LANG=C coverage run -a --source=sh -m unittest SH_TESTS_RUNNING=1 SH_TESTS_USE_SELECT=1 LANG=C coverage run -a --source=sh -m unittest SH_TESTS_RUNNING=1 SH_TESTS_USE_SELECT=0 LANG=en_US.UTF-8 coverage run -a --source=sh -m unittest diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..411bae83 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +requires = ["setuptools>=42.2.0", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] diff --git a/setup.cfg b/setup.cfg index af455ef5..2fc60a60 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,48 @@ universal = 1 [metadata] -license_file = LICENSE.txt +name = sh +author = Andrew Moffat +author_email = arwmoffat@gmail.com +maintainer = Andrew Moffat +maintainer_email = arwmoffat@gmail.com +license = MIT +description = Python subprocess replacement +keywords = + subprocess + process + shell + launch + program +url = https://github.com/amoffat/sh +long_description = file: README.rst +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Intended Audience :: Developers + Intended Audience :: System Administrators + License :: OSI Approved :: MIT License + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.6 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.1 + Programming Language :: Python :: 3.2 + Programming Language :: Python :: 3.3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Topic :: Software Development :: Build Tools + Topic :: Software Development :: Libraries :: Python Modules + +[options] +py_modules = sh [flake8] max-line-length = 120 diff --git a/setup.py b/setup.py deleted file mode 100644 index 08ec1a2b..00000000 --- a/setup.py +++ /dev/null @@ -1,59 +0,0 @@ -from __future__ import print_function -import os -from os.path import dirname, abspath, join -import sys -import sh -import codecs -from setuptools import setup - - -HERE = dirname(abspath(__file__)) - -author = "Andrew Moffat" -author_email = "arwmoffat@gmail.com" -keywords = ["subprocess", "process", "shell", "launch", "program"] - - -def read(*parts): - with codecs.open(join(HERE, *parts), "rb", "utf-8") as f: - return f.read() - -setup( - name="sh", - version=sh.__version__, - description="Python subprocess replacement", - long_description=read("README.rst"), - author=author, - author_email=author_email, - maintainer=author, - maintainer_email=author_email, - keywords=keywords, - url="https://github.com/amoffat/sh", - license="MIT", - py_modules=["sh"], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.1", - "Programming Language :: Python :: 3.2", - "Programming Language :: Python :: 3.3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Software Development :: Build Tools", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -) From 9503714f04f8c83bdf75988f800bd7f26258105d Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Tue, 18 Oct 2022 21:31:57 +0300 Subject: [PATCH 2/2] Move the metadata into `PEP 621`-compliant `pyproject.toml`. --- pyproject.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 49 --------------------------------------------- 2 files changed, 53 insertions(+), 50 deletions(-) delete mode 100644 setup.cfg diff --git a/pyproject.toml b/pyproject.toml index 411bae83..e95890e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,57 @@ [build-system] -requires = ["setuptools>=42.2.0", "setuptools_scm[toml]>=3.4.3"] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] build-backend = "setuptools.build_meta" +[project] +name = "sh" +authors = [{name = "Andrew Moffat", email = "arwmoffat@gmail.com"}] +maintainers = [{name = "Andrew Moffat", email = "arwmoffat@gmail.com"}] +license = {text = "MIT"} +description = "Python subprocess replacement" +keywords = [ + "subprocess", + "process", + "shell", + "launch", + "program", +] +readme = "README.rst" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.1", + "Programming Language :: Python :: 3.2", + "Programming Language :: Python :: 3.3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Software Development :: Build Tools", + "Topic :: Software Development :: Libraries :: Python Modules", +] +urls = {Homepage = "https://github.com/amoffat/sh"} +dynamic = ["version"] + +[tool.distutils.bdist_wheel] +universal = 1 + +[tool.setuptools] +py-modules = ["sh"] +include-package-data = false + [tool.setuptools_scm] + +[tool.flake8] +max-line-length = "120" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2fc60a60..00000000 --- a/setup.cfg +++ /dev/null @@ -1,49 +0,0 @@ -[bdist_wheel] -universal = 1 - -[metadata] -name = sh -author = Andrew Moffat -author_email = arwmoffat@gmail.com -maintainer = Andrew Moffat -maintainer_email = arwmoffat@gmail.com -license = MIT -description = Python subprocess replacement -keywords = - subprocess - process - shell - launch - program -url = https://github.com/amoffat/sh -long_description = file: README.rst -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Developers - Intended Audience :: System Administrators - License :: OSI Approved :: MIT License - Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.1 - Programming Language :: Python :: 3.2 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Software Development :: Build Tools - Topic :: Software Development :: Libraries :: Python Modules - -[options] -py_modules = sh - -[flake8] -max-line-length = 120