From c4c7b8eb945382dc18f8303043c96e0e068d88a0 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 10:49:28 +0200 Subject: [PATCH 1/9] Moved everything but entry_points and package_data into setup.cfg --- setup.cfg | 35 ++++++++++++++++++++++++++++++ setup.py | 65 +------------------------------------------------------ 2 files changed, 36 insertions(+), 64 deletions(-) diff --git a/setup.cfg b/setup.cfg index eb870bb5e99..5e45c4802c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,4 +41,39 @@ addopts = --ignore src/pip/_vendor --ignore tests/tests_cache -r aR universal = 1 [metadata] +name = pip +version = attr: src.pip.__version__ +url = https://pip.pypa.io/ +author = The pip developers +author_email = pypa-dev@groups.google.com +description = The PyPA recommended tool for installing Python packages. +long_description = file: README.rst +keywords = distutils, easy_install, egg, setuptools, wheel, virtualenv +license = MIT license_file = LICENSE.txt +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Topic :: Software Development :: Build Tools + Programming Language :: Python + 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 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + +[options] +zip_safe = False +package_dir= + =src +packages=find: +python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* + +[options.packages.find] +where = src +exclude = contrib, docs, tests*, tasks diff --git a/setup.py b/setup.py index e2e14b4965a..163ded0ce65 100644 --- a/setup.py +++ b/setup.py @@ -1,69 +1,9 @@ -import codecs -import os -import re import sys -from setuptools import find_packages, setup +from setuptools import setup -here = os.path.abspath(os.path.dirname(__file__)) - - -def read(*parts): - # intentionally *not* adding an encoding option to open, See: - # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 - with codecs.open(os.path.join(here, *parts), 'r') as fp: - return fp.read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, - re.M, - ) - if version_match: - return version_match.group(1) - - raise RuntimeError("Unable to find version string.") - - -long_description = read('README.rst') setup( - name="pip", - version=find_version("src", "pip", "__init__.py"), - description="The PyPA recommended tool for installing Python packages.", - long_description=long_description, - - license='MIT', - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Topic :: Software Development :: Build Tools", - "Programming Language :: Python", - "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", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - url='https://pip.pypa.io/', - keywords='distutils easy_install egg setuptools wheel virtualenv', - - author='The pip developers', - author_email='pypa-dev@groups.google.com', - - package_dir={"": "src"}, - packages=find_packages( - where="src", - exclude=["contrib", "docs", "tests*", "tasks"], - ), package_data={ "pip._vendor.certifi": ["*.pem"], "pip._vendor.requests": ["*.pem"], @@ -77,7 +17,4 @@ def find_version(*file_paths): "pip%s.%s=pip._internal:main" % sys.version_info[:2], ], }, - - zip_safe=False, - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', ) From 65262c7a005eb817c10968d29154b78b50534ac4 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 11:05:17 +0200 Subject: [PATCH 2/9] Added news file. Closes: #1697 --- news/1697.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/1697.feature diff --git a/news/1697.feature b/news/1697.feature new file mode 100644 index 00000000000..eeb3a5984a2 --- /dev/null +++ b/news/1697.feature @@ -0,0 +1 @@ +Moved most of the setup.py to declarative setup.cfg From 23ddf990bed60221b63e236ed642bd2099b4b307 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 11:25:03 +0200 Subject: [PATCH 3/9] Fixed gathering of version --- setup.cfg | 1 - setup.py | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 5e45c4802c7..7adc8c870d5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,7 +42,6 @@ universal = 1 [metadata] name = pip -version = attr: src.pip.__version__ url = https://pip.pypa.io/ author = The pip developers author_email = pypa-dev@groups.google.com diff --git a/setup.py b/setup.py index 163ded0ce65..7a2601b9b74 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,36 @@ +import codecs +import os +import re import sys from setuptools import setup +here = os.path.abspath(os.path.dirname(__file__)) + + +def read(*parts): + # intentionally *not* adding an encoding option to open, See: + # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 + with codecs.open(os.path.join(here, *parts), 'r') as fp: + return fp.read() + + +def find_version(*file_paths): + version_file = read(*file_paths) + version_match = re.search( + r"^__version__ = ['\"]([^'\"]*)['\"]", + version_file, + re.M, + ) + if version_match: + return version_match.group(1) + + raise RuntimeError("Unable to find version string.") + setup( + # unfortunately we can't just use attr: src.pip.__version__ here + version=find_version("src", "pip", "__init__.py"), package_data={ "pip._vendor.certifi": ["*.pem"], "pip._vendor.requests": ["*.pem"], From 4cc5df68a706c68c415d7d9d9520e1bee9f3abcc Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 11:54:27 +0200 Subject: [PATCH 4/9] Corrected issue number. --- news/{1697.feature => 6501.feature} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{1697.feature => 6501.feature} (100%) diff --git a/news/1697.feature b/news/6501.feature similarity index 100% rename from news/1697.feature rename to news/6501.feature From 3984411d60b898b5197eaebeb70d43302c1d6779 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 11:55:08 +0200 Subject: [PATCH 5/9] Fixed some whitespaces --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 7adc8c870d5..b785e593527 100644 --- a/setup.cfg +++ b/setup.cfg @@ -68,8 +68,8 @@ classifiers = [options] zip_safe = False -package_dir= - =src +package_dir = + = src packages=find: python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* From ac48c41e7f391a0f130f2b62cfd5cb0f89626c51 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Tue, 14 May 2019 14:07:02 +0200 Subject: [PATCH 6/9] fixed whitespace --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b785e593527..de534f63e37 100644 --- a/setup.cfg +++ b/setup.cfg @@ -70,7 +70,7 @@ classifiers = zip_safe = False package_dir = = src -packages=find: +packages = find: python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* [options.packages.find] From 83a8bb4e2b782def1dca048822789283af542274 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Wed, 15 May 2019 12:32:57 +0200 Subject: [PATCH 7/9] Moved version into setup.cfg removed all logic from setup.py that figured out the version --- setup.cfg | 1 + setup.py | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/setup.cfg b/setup.cfg index de534f63e37..2d393d32e79 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,6 +42,7 @@ universal = 1 [metadata] name = pip +version = attr: pip.__version__ url = https://pip.pypa.io/ author = The pip developers author_email = pypa-dev@groups.google.com diff --git a/setup.py b/setup.py index 7a2601b9b74..163ded0ce65 100644 --- a/setup.py +++ b/setup.py @@ -1,36 +1,9 @@ -import codecs -import os -import re import sys from setuptools import setup -here = os.path.abspath(os.path.dirname(__file__)) - - -def read(*parts): - # intentionally *not* adding an encoding option to open, See: - # https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 - with codecs.open(os.path.join(here, *parts), 'r') as fp: - return fp.read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, - re.M, - ) - if version_match: - return version_match.group(1) - - raise RuntimeError("Unable to find version string.") - setup( - # unfortunately we can't just use attr: src.pip.__version__ here - version=find_version("src", "pip", "__init__.py"), package_data={ "pip._vendor.certifi": ["*.pem"], "pip._vendor.requests": ["*.pem"], From 1d0650f8bcabfd52dd76770b7dde7fb50510f549 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Wed, 15 May 2019 12:53:23 +0200 Subject: [PATCH 8/9] removed empty line --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 163ded0ce65..b30a567e81b 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ from setuptools import setup - setup( package_data={ "pip._vendor.certifi": ["*.pem"], From df51cf8e85c66ba228089bb7e550e5ef1d0c7600 Mon Sep 17 00:00:00 2001 From: Bastian Venthur Date: Thu, 16 May 2019 13:19:48 +0200 Subject: [PATCH 9/9] BS commit to trigger new CI Pipeline run. --- news/6501.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/6501.feature b/news/6501.feature index eeb3a5984a2..9f496ae614f 100644 --- a/news/6501.feature +++ b/news/6501.feature @@ -1 +1 @@ -Moved most of the setup.py to declarative setup.cfg +Moved most of the setup.py to declarative setup.cfg.