From 5e7acb4c0a7ecadd4ab9765bb021a272a08ae33f Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 12:35:35 +0200 Subject: [PATCH] Migrate constants from setup.py to setup.cfg This also makes wheel an unconditional setup_requires dependency. Closes: #1697 --- setup.cfg | 42 +++++++++++++++++++++++++++++++++++++++++- setup.py | 51 --------------------------------------------------- 2 files changed, 41 insertions(+), 52 deletions(-) diff --git a/setup.cfg b/setup.cfg index 3945408162b..551569af7b2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,5 +18,45 @@ formats = zip universal = 1 [metadata] -license_file = LICENSE +name = setuptools version = 41.0.1 +description = Easily download, build, install, upgrade, and uninstall Python packages +author = Python Packaging Authority +author_email = distutils-sig@python.org +long_description = file: README.rst +long_description_content_type = text/x-rst; charset=UTF-8 +license_file = LICENSE +keywords = CPAN, PyPI, distutils, eggs, package, management +url = https://github.com/pypa/setuptools +project_urls = + Documentation = https://setuptools.readthedocs.io/ +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Topic :: Software Development :: Libraries :: Python Modules + Topic :: System :: Archiving :: Packaging + Topic :: System :: Systems Administration + Topic :: Utilities + +[options] +zip_safe = True +python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* +setup_requires = wheel +py_modules = easy_install +packages = find: + +[options.packages.find] +exclude = *.tests + +[options.extras_require] +ssl = wincertstore==0.2; sys_platform=='win32' +certs = certifi==2016.9.26 diff --git a/setup.py b/setup.py index 78d7018c981..b23effb179c 100755 --- a/setup.py +++ b/setup.py @@ -3,10 +3,8 @@ Distutils setup file, used to install or test 'setuptools' """ -import io import os import sys -import textwrap import setuptools @@ -49,10 +47,6 @@ def _gen_console_scripts(): yield tmpl.format(shortver=sys.version[:3]) -readme_path = os.path.join(here, 'README.rst') -with io.open(readme_path, encoding='utf-8') as readme_file: - long_description = readme_file.read() - package_data = dict( setuptools=['script (dev).tmpl', 'script.tmpl', 'site-patch.py'], ) @@ -72,9 +66,6 @@ def _gen_console_scripts(): package_data.setdefault('setuptools', []).extend(['*.exe']) package_data.setdefault('setuptools.command', []).extend(['*.xml']) -needs_wheel = set(['release', 'bdist_wheel']).intersection(sys.argv) -wheel = ['wheel'] if needs_wheel else [] - def pypi_link(pkg_filename): """ @@ -88,25 +79,8 @@ def pypi_link(pkg_filename): setup_params = dict( - name="setuptools", - description=( - "Easily download, build, install, upgrade, and uninstall " - "Python packages" - ), - author="Python Packaging Authority", - author_email="distutils-sig@python.org", - long_description=long_description, - long_description_content_type='text/x-rst; charset=UTF-8', - keywords="CPAN PyPI distutils eggs package management", - url="https://github.com/pypa/setuptools", - project_urls={ - "Documentation": "https://setuptools.readthedocs.io/", - }, src_root=None, - packages=setuptools.find_packages(exclude=['*.tests']), package_data=package_data, - py_modules=['easy_install'], - zip_safe=True, entry_points={ "distutils.commands": [ "%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals() @@ -152,28 +126,6 @@ def pypi_link(pkg_filename): "setuptools.installation": ['eggsecutable = setuptools.command.easy_install:bootstrap'], }, - classifiers=textwrap.dedent(""" - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Topic :: Software Development :: Libraries :: Python Modules - Topic :: System :: Archiving :: Packaging - Topic :: System :: Systems Administration - Topic :: Utilities - """).strip().splitlines(), - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', - extras_require={ - "ssl:sys_platform=='win32'": "wincertstore==0.2", - "certs": "certifi==2016.9.26", - }, dependency_links=[ pypi_link( 'certifi-2016.9.26.tar.gz#md5=baa81e951a29958563689d868ef1064d', @@ -182,9 +134,6 @@ def pypi_link(pkg_filename): 'wincertstore-0.2.zip#md5=ae728f2f007185648d0c7a8679b361e2', ), ], - scripts=[], - setup_requires=[ - ] + wheel, ) if __name__ == '__main__':