Imported Upstream version 40.5.0 upstream/40.5.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 14 Jan 2019 01:44:04 +0000 (10:44 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 14 Jan 2019 01:44:04 +0000 (10:44 +0900)
16 files changed:
.travis.yml
CHANGES.rst
appveyor.yml
docs/easy_install.txt
docs/setuptools.txt
pkg_resources/__init__.py
setup.cfg
setup.py
setuptools/command/easy_install.py
setuptools/config.py
setuptools/package_index.py
setuptools/tests/test_config.py
setuptools/tests/test_easy_install.py
setuptools/tests/test_pep425tags.py
setuptools/tests/test_setuptools.py
tox.ini

index 63d0333ae6fe6155a5093fbbca8b82495b498698..0e53bd29da0619b95c3abf41cd043a99047697f3 100644 (file)
@@ -1,25 +1,32 @@
 dist: trusty
-sudo: false
 language: python
-python:
-- &latest_py2 2.7
-- 3.4
-- 3.5
-- &latest_py3 3.6
-- nightly
-- pypy
-- pypy3
 
 jobs:
   fast_finish: true
   include:
-  - python: *latest_py3
+  - &latest_py2
+    python: 2.7
+  - <<: *latest_py2
     env: LANG=C
-  - python: *latest_py2
+  - python: pypy
+    env: DISABLE_COVERAGE=1  # Don't run coverage on pypy (too slow).
+  - python: pypy3
+    env: DISABLE_COVERAGE=1
+  - python: 3.4
+  - python: 3.5
+  - &default_py
+    python: 3.6
+  - &latest_py3
+    python: 3.7
+    dist: xenial
+  - <<: *latest_py3
     env: LANG=C
-  - stage: deploy (to PyPI for tagged commits)
+  - python: 3.8-dev
+    dist: xenial
+    env: DISABLE_COVERAGE=1  # Ignore invalid coverage data.
+  - <<: *default_py
+    stage: deploy (to PyPI for tagged commits)
     if: tag IS present
-    python: *latest_py3
     install: skip
     script: skip
     after_success: true
@@ -39,12 +46,14 @@ jobs:
 cache: pip
 
 install:
-# ensure we have recent pip/setuptools
-- pip install --upgrade pip setuptools
+
+# ensure we have recent pip/setuptools/wheel
+- pip install --disable-pip-version-check --upgrade pip setuptools wheel
 # need tox to get started
-- pip install tox tox-venv
+- pip install --upgrade tox tox-venv
 
 # Output the env, to verify behavior
+- pip freeze --all
 - env
 
 # update egg_info based on setup.py in checkout
@@ -53,28 +62,20 @@ install:
 script:
   - |
     ( # Run testsuite.
-      set -ex
-      case $TRAVIS_PYTHON_VERSION in
-      pypy*)
-        # Don't run coverage on pypy (too slow).
-        tox
-        ;;
-      *)
+      if [ -z "$DISABLE_COVERAGE" ]
+      then
         tox -- --cov
-        ;;
-      esac
+      else
+        tox
+      fi
     )
 
 after_success:
   - |
     ( # Upload coverage data.
-      set -ex
-      case $TRAVIS_PYTHON_VERSION in
-      pypy*)
-        ;;
-        *)
+      if [ -z "$DISABLE_COVERAGE" ]
+      then
         export TRAVIS_JOB_NAME="${TRAVIS_PYTHON_VERSION} (LANG=$LANG)" CODECOV_ENV=TRAVIS_JOB_NAME
         tox -e coverage,codecov
-        ;;
-      esac
+      fi
     )
index 263a19aa1cdcdb39680b95d35a88249ba7fe765f..ca07119d959082ac084d9263bebb20b4f68510c3 100644 (file)
@@ -1,3 +1,13 @@
+v40.5.0
+-------
+
+* #1335: In ``pkg_resources.normalize_path``, fix issue on Cygwin when cwd contains symlinks.
+* #1502: Deprecated support for downloads from Subversion in package_index/easy_install.
+* #1517: Dropped use of six.u in favor of `u""` literals.
+* #1520: Added support for ``data_files`` in ``setup.cfg``.
+* #1525: Fixed rendering of the deprecation warning in easy_install doc.
+
+
 v40.4.3
 -------
 
index f50f8386ac7f8331ada90fc88f296978dfcac5e9..ef4a9f7e356c5bb6b95a73e2fc2749868b4c5787 100644 (file)
@@ -1,3 +1,5 @@
+clone_depth: 50
+
 environment:
 
   APPVEYOR: True
@@ -21,9 +23,12 @@ cache:
   - '%LOCALAPPDATA%\pip\Cache'
 
 test_script:
-  - "python bootstrap.py"
-  - "python -m pip install tox"
-  - "tox -- --cov"
+  - python --version
+  - python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel
+  - pip install --upgrade tox tox-venv
+  - pip freeze --all
+  - python bootstrap.py
+  - tox -- --cov
 
 after_test:
     - tox -e coverage,codecov
index 41d182e04197276cec877fefad996f20a83ce879..aa11f890838d9108f91a4a52960a5130e0019b36 100644 (file)
@@ -2,7 +2,7 @@
 Easy Install
 ============
 
-..warning::
+.. warning::
     Easy Install is deprecated. Do not use it. Instead use pip. If
     you think you need Easy Install, please reach out to the PyPA
     team (a ticket to pip or setuptools is fine), describing your
index 89f45bd8572bc02035c72fc0ef3b68d5fb448820..da9b0132e18bfe77329db1e7c91e7aa30213b393 100644 (file)
@@ -2367,6 +2367,11 @@ boilerplate code in some cases.
         src.subpackage1
         src.subpackage2
 
+    [options.data_files]
+    /etc/my_package =
+        site.d/00_default.conf
+        host.d/00_default.conf
+    data = data/img/logo.png, data/svg/icon.svg
 
 Metadata and options are set in the config sections of the same name.
 
index 3ae2c5cdb701e25b27ddf7b3478036268deccadf..74134701371327b52282483b8174e6595b6e09cf 100644 (file)
@@ -2228,7 +2228,18 @@ register_namespace_handler(object, null_ns_handler)
 
 def normalize_path(filename):
     """Normalize a file/dir name for comparison purposes"""
-    return os.path.normcase(os.path.realpath(filename))
+    return os.path.normcase(os.path.realpath(_cygwin_patch(filename)))
+
+
+def _cygwin_patch(filename):  # pragma: nocover
+    """
+    Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
+    symlink components. Using
+    os.path.abspath() works around this limitation. A fix in os.getcwd()
+    would probably better, in Cygwin even more so, except
+    that this seems to be by design...
+    """
+    return os.path.abspath(filename) if sys.platform == 'cygwin' else filename
 
 
 def _normalize_cached(filename, _cache={}):
index 55347d619e5becd771c000bf13a715e97cc51552..5f7abd39408629dc0e54682c0227700a72a5990c 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 40.4.3
+current_version = 40.5.0
 commit = True
 tag = True
 
index b37082c4bac00202f74a46aee896b21101eaee3c..2cac67a2b06305a51db68388f2bad00c79519595 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -89,7 +89,7 @@ def pypi_link(pkg_filename):
 
 setup_params = dict(
     name="setuptools",
-    version="40.4.3",
+    version="40.5.0",
     description=(
         "Easily download, build, install, upgrade, and uninstall "
         "Python packages"
index dd17cc13f5876bca19e3ea1a402c59e88b8a808a..c670a16e613587f05520d1b5a12ab52304ac8b1d 100644 (file)
@@ -632,7 +632,7 @@ class easy_install(Command):
 
     @contextlib.contextmanager
     def _tmpdir(self):
-        tmpdir = tempfile.mkdtemp(prefix=six.u("easy_install-"))
+        tmpdir = tempfile.mkdtemp(prefix=u"easy_install-")
         try:
             # cast to str as workaround for #709 and #710 and #712
             yield str(tmpdir)
@@ -2085,12 +2085,10 @@ class ScriptWriter:
     @classmethod
     def get_script_header(cls, script_text, executable=None, wininst=False):
         # for backward compatibility
-        warnings.warn("Use get_header", DeprecationWarning)
+        warnings.warn("Use get_header", DeprecationWarning, stacklevel=2)
         if wininst:
             executable = "python.exe"
-        cmd = cls.command_spec_class.best().from_param(executable)
-        cmd.install_options(script_text)
-        return cmd.as_header()
+        return cls.get_header(script_text, executable)
 
     @classmethod
     def get_args(cls, dist, header=None):
index 0da3dbc9cf221ae3eecbdcab13a4ec419fc29920..73a3bf70314546c9f7ae9c425ef5e09ea0c1f90b 100644 (file)
@@ -598,3 +598,11 @@ class ConfigOptionsHandler(ConfigHandler):
         parse_list = partial(self._parse_list, separator=';')
         self['extras_require'] = self._parse_section_to_dict(
             section_options, parse_list)
+
+    def parse_section_data_files(self, section_options):
+        """Parses `data_files` configuration file section.
+
+        :param dict section_options:
+        """
+        parsed = self._parse_section_to_dict(section_options, self._parse_list)
+        self['data_files'] = [(k, v) for k, v in parsed.items()]
index cda54b71713d058acbea929dc60c7d249d08b54d..1608b91acedf82845cc3ea03ab8927393db889f3 100644 (file)
@@ -7,6 +7,7 @@ import socket
 import base64
 import hashlib
 import itertools
+import warnings
 from functools import wraps
 
 from setuptools.extern import six
@@ -848,6 +849,7 @@ class PackageIndex(Environment):
         raise DistutilsError("Unexpected HTML page found at " + url)
 
     def _download_svn(self, url, filename):
+        warnings.warn("SVN download support is deprecated", UserWarning)
         url = url.split('#', 1)[0]  # remove any fragment for svn's sake
         creds = ''
         if url.lower().startswith('svn:') and '@' in url:
@@ -980,8 +982,7 @@ def _encode_auth(auth):
     auth_s = urllib.parse.unquote(auth)
     # convert to bytes
     auth_bytes = auth_s.encode()
-    # use the legacy interface for Python 2.3 support
-    encoded_bytes = base64.encodestring(auth_bytes)
+    encoded_bytes = base64.b64encode(auth_bytes)
     # convert back to a string
     encoded = encoded_bytes.decode()
     # strip the trailing carriage return
index acf221549b98585f9c153a89d0a3a2c0836a9597..76759ec57c06087b00dc08a518050b61aadee390 100644 (file)
@@ -703,6 +703,23 @@ class TestOptions:
         with get_dist(tmpdir) as dist:
             assert dist.entry_points == expected
 
+    def test_data_files(self, tmpdir):
+        fake_env(
+            tmpdir,
+            '[options.data_files]\n'
+            'cfg =\n'
+            '      a/b.conf\n'
+            '      c/d.conf\n'
+            'data = e/f.dat, g/h.dat\n'
+        )
+
+        with get_dist(tmpdir) as dist:
+            expected = [
+                ('cfg', ['a/b.conf', 'c/d.conf']),
+                ('data', ['e/f.dat', 'g/h.dat']),
+            ]
+            assert sorted(dist.data_files) == sorted(expected)
+
 saved_dist_init = _Distribution.__init__
 class TestExternalSetters:
     # During creation of the setuptools Distribution() object, we call
index 955c2ae94e3b8d365b5288cc052737ac1c77cc54..b0cc4c9fbc620f9a781aaff4b6ceae0a84fcac53 100644 (file)
@@ -288,6 +288,7 @@ class TestEasyInstallTest:
         assert (target / 'mypkg_script').exists()
 
 
+@pytest.mark.filterwarnings('ignore:Unbuilt egg')
 class TestPTHFileWriter:
     def test_add_from_cwd_site_sets_dirty(self):
         '''a pth file manager should set dirty
@@ -756,24 +757,24 @@ class TestScriptHeader:
 
     def test_get_script_header(self):
         expected = '#!%s\n' % ei.nt_quote_arg(os.path.normpath(sys.executable))
-        actual = ei.ScriptWriter.get_script_header('#!/usr/local/bin/python')
+        actual = ei.ScriptWriter.get_header('#!/usr/local/bin/python')
         assert actual == expected
 
     def test_get_script_header_args(self):
         expected = '#!%s -x\n' % ei.nt_quote_arg(
             os.path.normpath(sys.executable))
-        actual = ei.ScriptWriter.get_script_header('#!/usr/bin/python -x')
+        actual = ei.ScriptWriter.get_header('#!/usr/bin/python -x')
         assert actual == expected
 
     def test_get_script_header_non_ascii_exe(self):
-        actual = ei.ScriptWriter.get_script_header(
+        actual = ei.ScriptWriter.get_header(
             '#!/usr/bin/python',
             executable=self.non_ascii_exe)
         expected = str('#!%s -x\n') % self.non_ascii_exe
         assert actual == expected
 
     def test_get_script_header_exe_with_spaces(self):
-        actual = ei.ScriptWriter.get_script_header(
+        actual = ei.ScriptWriter.get_header(
             '#!/usr/bin/python',
             executable='"' + self.exe_with_spaces + '"')
         expected = '#!"%s"\n' % self.exe_with_spaces
@@ -817,7 +818,7 @@ class TestCommandSpec:
 
 class TestWindowsScriptWriter:
     def test_header(self):
-        hdr = ei.WindowsScriptWriter.get_script_header('')
+        hdr = ei.WindowsScriptWriter.get_header('')
         assert hdr.startswith('#!')
         assert hdr.endswith('\n')
         hdr = hdr.lstrip('#!')
index 658784ac95dac811ed3b86c3a9b9a1ca81acf0ad..f558a0d87c3705dfd17f62504d0c31bf5551b4b4 100644 (file)
@@ -1,5 +1,6 @@
 import sys
 
+import pytest
 from mock import patch
 
 from setuptools import pep425tags
@@ -64,7 +65,8 @@ class TestPEP425Tags:
 
         with patch('setuptools.pep425tags.sysconfig.get_config_var',
                    raises_ioerror):
-            assert len(pep425tags.get_supported())
+            with pytest.warns(RuntimeWarning):
+                assert len(pep425tags.get_supported())
 
     def test_no_hyphen_tag(self):
         """
index 26e37a6c14ea1416debcf31d753dc4cb7140f45f..7aae3a163a93e7bed0783a300ccc72c6cce63049 100644 (file)
@@ -210,6 +210,7 @@ class TestDistro:
             self.dist.exclude(package_dir=['q'])
 
 
+@pytest.mark.filterwarnings('ignore:Features are deprecated')
 class TestFeatures:
     def setup_method(self, method):
         self.req = Require('Distutils', '1.0.3', 'distutils')
diff --git a/tox.ini b/tox.ini
index 3b03b7db1759307d0460330d4223acb7f986f941..a2f850dff52a28e688a0fafe7f3bef2c0b0b7d8a 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -37,7 +37,7 @@ commands=coverage erase
 description=[Only run on CI]: Upload coverage data to codecov
 deps=codecov
 skip_install=True
-commands=codecov --file {toxworkdir}/coverage.xml
+commands=codecov -X gcov --file {toxworkdir}/coverage.xml
 
 [testenv:docs]
 deps = -r{toxinidir}/docs/requirements.txt