Commit 06715b63 authored by idle sign's avatar idle sign

Merge branch 'remote_pypa_master' into feat/setupcfg_handling

parents ef583b28 aac9f9f3
...@@ -8,7 +8,6 @@ python: ...@@ -8,7 +8,6 @@ python:
- "3.6-dev" - "3.6-dev"
- nightly - nightly
- pypy - pypy
- pypy3
env: env:
- "" - ""
- LC_ALL=C LC_CTYPE=C - LC_ALL=C LC_CTYPE=C
......
======= v30.1.0
CHANGES -------
=======
* #846: Also trap 'socket.error' when opening URLs in
package_index.
* #849: Manifest processing now matches the filename
pattern anywhere in the filename and not just at the
start. Restores behavior found prior to 28.5.0.
v30.0.0
-------
* #864: Drop support for Python 3.2. Systems requiring
Python 3.2 support must use 'setuptools < 30'.
* #825: Suppress warnings for single files.
* #830 via #843: Once again restored inclusion of data
files to sdists, but now trap TypeError caused by
techniques employed rjsmin and similar.
v29.0.1 v29.0.1
------- -------
......
import pytest import os
pytest_plugins = 'setuptools.tests.fixtures' pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser): def pytest_addoption(parser):
parser.addoption("--package_name", action="append", default=[], parser.addoption(
help="list of package_name to pass to test functions") "--package_name", action="append", default=[],
help="list of package_name to pass to test functions",
)
def pytest_configure():
_issue_852_workaround()
def _issue_852_workaround():
"""
Patch 'setuptools.__file__' with an absolute path
for forward compatibility with Python 3.
Workaround for https://github.com/pypa/setuptools/issues/852
"""
setuptools = __import__('setuptools')
setuptools.__file__ = os.path.abspath(setuptools.__file__)
...@@ -831,10 +831,9 @@ correspond exactly to the constructor argument names: ``name``, ...@@ -831,10 +831,9 @@ correspond exactly to the constructor argument names: ``name``,
``module_name``, ``attrs``, ``extras``, and ``dist`` are all available. In ``module_name``, ``attrs``, ``extras``, and ``dist`` are all available. In
addition, the following methods are provided: addition, the following methods are provided:
``load(require=True, env=None, installer=None)`` ``load()``
Load the entry point, returning the advertised Python object, or raise Load the entry point, returning the advertised Python object. Effectively
``ImportError`` if it cannot be obtained. If `require` is a true value, calls ``self.require()`` then returns ``self.resolve()``.
then ``require(env, installer)`` is called before attempting the import.
``require(env=None, installer=None)`` ``require(env=None, installer=None)``
Ensure that any "extras" needed by the entry point are available on Ensure that any "extras" needed by the entry point are available on
...@@ -846,6 +845,10 @@ addition, the following methods are provided: ...@@ -846,6 +845,10 @@ addition, the following methods are provided:
taking a ``Requirement`` instance and returning a matching importable taking a ``Requirement`` instance and returning a matching importable
``Distribution`` instance or None. ``Distribution`` instance or None.
``resolve()``
Resolve the entry point from its module and attrs, returning the advertised
Python object. Raises ``ImportError`` if it cannot be obtained.
``__str__()`` ``__str__()``
The string form of an ``EntryPoint`` is a string that could be passed to The string form of an ``EntryPoint`` is a string that could be passed to
``EntryPoint.parse()`` to produce an equivalent ``EntryPoint``. ``EntryPoint.parse()`` to produce an equivalent ``EntryPoint``.
......
...@@ -75,11 +75,7 @@ __import__('pkg_resources.extern.packaging.requirements') ...@@ -75,11 +75,7 @@ __import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers') __import__('pkg_resources.extern.packaging.markers')
if (3, 0) < sys.version_info < (3, 3): if (3, 0) < sys.version_info < (3, 3):
msg = ( raise RuntimeError("Python 3.3 or later is required")
"Support for Python 3.0-3.2 has been dropped. Future versions "
"will fail here."
)
warnings.warn(msg)
# declare some globals that will be defined later to # declare some globals that will be defined later to
# satisfy the linters. # satisfy the linters.
......
[bumpversion] [bumpversion]
current_version = 29.0.1 current_version = 30.0.0
commit = True commit = True
tag = True tag = True
......
...@@ -85,7 +85,7 @@ def pypi_link(pkg_filename): ...@@ -85,7 +85,7 @@ def pypi_link(pkg_filename):
setup_params = dict( setup_params = dict(
name="setuptools", name="setuptools",
version="29.0.1", version="30.0.0",
description="Easily download, build, install, upgrade, and uninstall " description="Easily download, build, install, upgrade, and uninstall "
"Python packages", "Python packages",
author="Python Packaging Authority", author="Python Packaging Authority",
......
...@@ -457,7 +457,7 @@ class FileList(_FileList): ...@@ -457,7 +457,7 @@ class FileList(_FileList):
""" """
if self.allfiles is None: if self.allfiles is None:
self.findall() self.findall()
match = translate_pattern(os.path.join('**', pattern)) match = translate_pattern(os.path.join('**', '*' + pattern))
found = [f for f in self.allfiles if match.match(f)] found = [f for f in self.allfiles if match.match(f)]
self.extend(found) self.extend(found)
return bool(found) return bool(found)
...@@ -466,7 +466,7 @@ class FileList(_FileList): ...@@ -466,7 +466,7 @@ class FileList(_FileList):
""" """
Exclude all files anywhere that match the pattern. Exclude all files anywhere that match the pattern.
""" """
match = translate_pattern(os.path.join('**', pattern)) match = translate_pattern(os.path.join('**', '*' + pattern))
return self._remove_files(match.match) return self._remove_files(match.match)
def append(self, item): def append(self, item):
...@@ -554,10 +554,17 @@ class manifest_maker(sdist): ...@@ -554,10 +554,17 @@ class manifest_maker(sdist):
msg = "writing manifest file '%s'" % self.manifest msg = "writing manifest file '%s'" % self.manifest
self.execute(write_file, (self.manifest, files), msg) self.execute(write_file, (self.manifest, files), msg)
def warn(self, msg): # suppress missing-file warnings from sdist def warn(self, msg):
if not msg.startswith("standard file not found:"): if not self._should_suppress_warning(msg):
sdist.warn(self, msg) sdist.warn(self, msg)
@staticmethod
def _should_suppress_warning(msg):
"""
suppress missing-file warnings from sdist
"""
return re.match(r"standard file .*not found", msg)
def add_defaults(self): def add_defaults(self):
sdist.add_defaults(self) sdist.add_defaults(self)
self.filelist.append(self.template) self.filelist.append(self.template)
......
...@@ -142,9 +142,13 @@ class sdist(sdist_add_defaults, orig.sdist): ...@@ -142,9 +142,13 @@ class sdist(sdist_add_defaults, orig.sdist):
for filename in filenames]) for filename in filenames])
def _add_defaults_data_files(self): def _add_defaults_data_files(self):
""" try:
Don't add any data files, but why? if six.PY2:
""" sdist_add_defaults._add_defaults_data_files(self)
else:
super()._add_defaults_data_files()
except TypeError:
log.warn("data_files contains unexpected objects")
def check_readme(self): def check_readme(self):
for f in self.READMES: for f in self.READMES:
......
...@@ -768,7 +768,7 @@ class PackageIndex(Environment): ...@@ -768,7 +768,7 @@ class PackageIndex(Environment):
'down, %s' % 'down, %s' %
(url, v.line) (url, v.line)
) )
except http_client.HTTPException as v: except (http_client.HTTPException, socket.error) as v:
if warning: if warning:
self.warn(warning, v) self.warn(warning, v)
else: else:
......
...@@ -4,7 +4,7 @@ import re ...@@ -4,7 +4,7 @@ import re
import stat import stat
import sys import sys
from setuptools.command.egg_info import egg_info from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution from setuptools.dist import Distribution
from setuptools.extern.six.moves import map from setuptools.extern.six.moves import map
...@@ -237,6 +237,15 @@ class TestEggInfo(object): ...@@ -237,6 +237,15 @@ class TestEggInfo(object):
pkginfo = os.path.join(egg_info_dir, 'PKG-INFO') pkginfo = os.path.join(egg_info_dir, 'PKG-INFO')
assert 'Requires-Python: >=1.2.3' in open(pkginfo).read().split('\n') assert 'Requires-Python: >=1.2.3' in open(pkginfo).read().split('\n')
def test_manifest_maker_warning_suppresion(self):
fixtures = [
"standard file not found: should have one of foo.py, bar.py",
"standard file 'setup.py' not found"
]
for msg in fixtures:
assert manifest_maker._should_suppress_warning(msg)
def _run_install_command(self, tmpdir_cwd, env, cmd=None, output=None): def _run_install_command(self, tmpdir_cwd, env, cmd=None, output=None):
environ = os.environ.copy().update( environ = os.environ.copy().update(
HOME=env.paths['home'], HOME=env.paths['home'],
......
...@@ -449,6 +449,11 @@ class TestFileListTest(TempDirTestCase): ...@@ -449,6 +449,11 @@ class TestFileListTest(TempDirTestCase):
assert file_list.files == ['a.py', l('d/c.py')] assert file_list.files == ['a.py', l('d/c.py')]
self.assertWarnings() self.assertWarnings()
file_list.process_template_line('global-include .txt')
file_list.sort()
assert file_list.files == ['a.py', 'b.txt', l('d/c.py')]
self.assertNoWarnings()
def test_global_exclude(self): def test_global_exclude(self):
l = make_local_path l = make_local_path
# global-exclude # global-exclude
...@@ -465,6 +470,13 @@ class TestFileListTest(TempDirTestCase): ...@@ -465,6 +470,13 @@ class TestFileListTest(TempDirTestCase):
assert file_list.files == ['b.txt'] assert file_list.files == ['b.txt']
self.assertWarnings() self.assertWarnings()
file_list = FileList()
file_list.files = ['a.py', 'b.txt', l('d/c.pyc'), 'e.pyo']
file_list.process_template_line('global-exclude .py[co]')
file_list.sort()
assert file_list.files == ['a.py', 'b.txt']
self.assertNoWarnings()
def test_recursive_include(self): def test_recursive_include(self):
l = make_local_path l = make_local_path
# recursive-include # recursive-include
......
...@@ -13,7 +13,7 @@ class TestNamespaces: ...@@ -13,7 +13,7 @@ class TestNamespaces:
@pytest.mark.xfail(sys.version_info < (3, 3), @pytest.mark.xfail(sys.version_info < (3, 3),
reason="Requires PEP 420") reason="Requires PEP 420")
@pytest.mark.skipif(os.environ.get("APPVEYOR"), @pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
reason="https://github.com/pypa/setuptools/issues/851") reason="https://github.com/pypa/setuptools/issues/851")
def test_mixed_site_and_non_site(self, tmpdir): def test_mixed_site_and_non_site(self, tmpdir):
""" """
......
...@@ -26,7 +26,8 @@ SETUP_ATTRS = { ...@@ -26,7 +26,8 @@ SETUP_ATTRS = {
'name': 'sdist_test', 'name': 'sdist_test',
'version': '0.0', 'version': '0.0',
'packages': ['sdist_test'], 'packages': ['sdist_test'],
'package_data': {'sdist_test': ['*.txt']} 'package_data': {'sdist_test': ['*.txt']},
'data_files': [("data", [os.path.join("d", "e.dat")])],
} }
SETUP_PY = """\ SETUP_PY = """\
...@@ -95,9 +96,12 @@ class TestSdistTest: ...@@ -95,9 +96,12 @@ class TestSdistTest:
# Set up the rest of the test package # Set up the rest of the test package
test_pkg = os.path.join(self.temp_dir, 'sdist_test') test_pkg = os.path.join(self.temp_dir, 'sdist_test')
os.mkdir(test_pkg) os.mkdir(test_pkg)
data_folder = os.path.join(self.temp_dir, "d")
os.mkdir(data_folder)
# *.rst was not included in package_data, so c.rst should not be # *.rst was not included in package_data, so c.rst should not be
# automatically added to the manifest when not under version control # automatically added to the manifest when not under version control
for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst']: for fname in ['__init__.py', 'a.txt', 'b.txt', 'c.rst',
os.path.join(data_folder, "e.dat")]:
# Just touch the files; their contents are irrelevant # Just touch the files; their contents are irrelevant
open(os.path.join(test_pkg, fname), 'w').close() open(os.path.join(test_pkg, fname), 'w').close()
...@@ -126,6 +130,7 @@ class TestSdistTest: ...@@ -126,6 +130,7 @@ class TestSdistTest:
assert os.path.join('sdist_test', 'a.txt') in manifest assert os.path.join('sdist_test', 'a.txt') in manifest
assert os.path.join('sdist_test', 'b.txt') in manifest assert os.path.join('sdist_test', 'b.txt') in manifest
assert os.path.join('sdist_test', 'c.rst') not in manifest assert os.path.join('sdist_test', 'c.rst') not in manifest
assert os.path.join('d', 'e.dat') in manifest
def test_defaults_case_sensitivity(self): def test_defaults_case_sensitivity(self):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment