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:
- "3.6-dev"
- nightly
- pypy
- pypy3
env:
- ""
- LC_ALL=C LC_CTYPE=C
......
=======
CHANGES
=======
v30.1.0
-------
* #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
-------
......
import pytest
import os
pytest_plugins = 'setuptools.tests.fixtures'
def pytest_addoption(parser):
parser.addoption("--package_name", action="append", default=[],
help="list of package_name to pass to test functions")
parser.addoption(
"--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``,
``module_name``, ``attrs``, ``extras``, and ``dist`` are all available. In
addition, the following methods are provided:
``load(require=True, env=None, installer=None)``
Load the entry point, returning the advertised Python object, or raise
``ImportError`` if it cannot be obtained. If `require` is a true value,
then ``require(env, installer)`` is called before attempting the import.
``load()``
Load the entry point, returning the advertised Python object. Effectively
calls ``self.require()`` then returns ``self.resolve()``.
``require(env=None, installer=None)``
Ensure that any "extras" needed by the entry point are available on
......@@ -846,6 +845,10 @@ addition, the following methods are provided:
taking a ``Requirement`` instance and returning a matching importable
``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__()``
The string form of an ``EntryPoint`` is a string that could be passed to
``EntryPoint.parse()`` to produce an equivalent ``EntryPoint``.
......
......@@ -75,11 +75,7 @@ __import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers')
if (3, 0) < sys.version_info < (3, 3):
msg = (
"Support for Python 3.0-3.2 has been dropped. Future versions "
"will fail here."
)
warnings.warn(msg)
raise RuntimeError("Python 3.3 or later is required")
# declare some globals that will be defined later to
# satisfy the linters.
......
[bumpversion]
current_version = 29.0.1
current_version = 30.0.0
commit = True
tag = True
......
......@@ -85,7 +85,7 @@ def pypi_link(pkg_filename):
setup_params = dict(
name="setuptools",
version="29.0.1",
version="30.0.0",
description="Easily download, build, install, upgrade, and uninstall "
"Python packages",
author="Python Packaging Authority",
......
......@@ -457,7 +457,7 @@ class FileList(_FileList):
"""
if self.allfiles is None:
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)]
self.extend(found)
return bool(found)
......@@ -466,7 +466,7 @@ class FileList(_FileList):
"""
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)
def append(self, item):
......@@ -554,10 +554,17 @@ class manifest_maker(sdist):
msg = "writing manifest file '%s'" % self.manifest
self.execute(write_file, (self.manifest, files), msg)
def warn(self, msg): # suppress missing-file warnings from sdist
if not msg.startswith("standard file not found:"):
def warn(self, msg):
if not self._should_suppress_warning(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):
sdist.add_defaults(self)
self.filelist.append(self.template)
......
......@@ -142,9 +142,13 @@ class sdist(sdist_add_defaults, orig.sdist):
for filename in filenames])
def _add_defaults_data_files(self):
"""
Don't add any data files, but why?
"""
try:
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):
for f in self.READMES:
......
......@@ -768,7 +768,7 @@ class PackageIndex(Environment):
'down, %s' %
(url, v.line)
)
except http_client.HTTPException as v:
except (http_client.HTTPException, socket.error) as v:
if warning:
self.warn(warning, v)
else:
......
......@@ -4,7 +4,7 @@ import re
import stat
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.extern.six.moves import map
......@@ -237,6 +237,15 @@ class TestEggInfo(object):
pkginfo = os.path.join(egg_info_dir, 'PKG-INFO')
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):
environ = os.environ.copy().update(
HOME=env.paths['home'],
......
......@@ -449,6 +449,11 @@ class TestFileListTest(TempDirTestCase):
assert file_list.files == ['a.py', l('d/c.py')]
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):
l = make_local_path
# global-exclude
......@@ -465,6 +470,13 @@ class TestFileListTest(TempDirTestCase):
assert file_list.files == ['b.txt']
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):
l = make_local_path
# recursive-include
......
......@@ -13,7 +13,7 @@ class TestNamespaces:
@pytest.mark.xfail(sys.version_info < (3, 3),
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")
def test_mixed_site_and_non_site(self, tmpdir):
"""
......
......@@ -26,7 +26,8 @@ SETUP_ATTRS = {
'name': 'sdist_test',
'version': '0.0',
'packages': ['sdist_test'],
'package_data': {'sdist_test': ['*.txt']}
'package_data': {'sdist_test': ['*.txt']},
'data_files': [("data", [os.path.join("d", "e.dat")])],
}
SETUP_PY = """\
......@@ -95,9 +96,12 @@ class TestSdistTest:
# Set up the rest of the test package
test_pkg = os.path.join(self.temp_dir, 'sdist_test')
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
# 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
open(os.path.join(test_pkg, fname), 'w').close()
......@@ -126,6 +130,7 @@ class TestSdistTest:
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', 'c.rst') not in manifest
assert os.path.join('d', 'e.dat') in manifest
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