aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-30 14:55:19 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-30 14:55:19 -0400
commit020b6a46477e6ddf9dc9e9e2b70b4c8b66ac50c6 (patch)
tree39826887f80b3ff252010f0b5e0e9ca7bc2c03b4
parentf0ba60597c0a07867e39ed2ce0733b6cac3ef470 (diff)
parent74de4e985eda49e38ece5805e05197dd4d2d9c8a (diff)
downloadexternal_python_setuptools-020b6a46477e6ddf9dc9e9e2b70b4c8b66ac50c6.tar.gz
external_python_setuptools-020b6a46477e6ddf9dc9e9e2b70b4c8b66ac50c6.tar.bz2
external_python_setuptools-020b6a46477e6ddf9dc9e9e2b70b4c8b66ac50c6.zip
Merge branch 'master' into distutils
-rw-r--r--.bumpversion.cfg2
-rw-r--r--.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md8
-rw-r--r--.travis.yml5
-rw-r--r--CHANGES.rst29
-rw-r--r--changelog.d/1700.change.rst1
-rw-r--r--docs/build_meta.txt2
-rw-r--r--docs/developer-guide.txt10
-rw-r--r--docs/pkg_resources.txt2
-rw-r--r--docs/python 2 sunset.txt69
-rw-r--r--pkg_resources/__init__.py33
-rw-r--r--pkg_resources/py2_warn.py19
-rw-r--r--setup.cfg2
-rw-r--r--setuptools/__init__.py25
-rw-r--r--setuptools/wheel.py8
-rw-r--r--tox.ini2
15 files changed, 166 insertions, 51 deletions
diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 72d02f2b..23226c35 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 46.4.0
+current_version = 47.1.1
commit = True
tag = True
diff --git a/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md b/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md
index 2f5fe53d..1a4f58f2 100644
--- a/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md
+++ b/.github/ISSUE_TEMPLATE/setuptools-warns-about-python-2-incompatibility.md
@@ -13,7 +13,7 @@ Please DO NOT SUBMIT this template without first investigating the issue and ans
If you did not intend to use this template, but only meant to file a blank issue, just hit the back button and click "Open a blank issue".
-It's by design that Setuptools 45 and later will stop working on Python 2. To ease the transition, Setuptools 45 was released to continue to have Python 2 compatibility, but emit a strenuous warning that it will stop working.
+Setuptools 45 dropped support for Python 2 with a strenuous warning and Setuptools 47 fails to run on Python 2.
In most cases, using pip 9 or later to install Setuptools from PyPI or any index supporting the Requires-Python metadata will do the right thing and install Setuptools 44.x on Python 2.
@@ -28,6 +28,7 @@ Your first course of action should be to reason about how you managed to get an
<!-- These are the recommended workarounds for the issue. Please
try them first. -->
+- [ ] Read [Python 2 Sunset docs](https://setuptools.readthedocs.io/en/latest/python%202%20sunset.html).
- [ ] Python 2 is required for this application.
- [ ] I maintain the software that installs Setuptools (if not, please contact that project).
- [ ] Setuptools installed with pip 9 or later.
@@ -40,6 +41,11 @@ try them first. -->
- Python installed how:
- Virtualenv version (if using virtualenv): n/a
+Command(s) that triggered the warning/error (and output):
+
+```
+```
+
Command(s) used to install setuptools (and output):
```
diff --git a/.travis.yml b/.travis.yml
index 25cfb6e4..f97abc51 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,11 +4,6 @@ language: python
jobs:
fast_finish: true
include:
- - &latest_py2
- python: 2.7
- env: TOXENV=py27
- - <<: *latest_py2
- env: LANG=C TOXENV=py27
- python: pypy3
env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- python: 3.5
diff --git a/CHANGES.rst b/CHANGES.rst
index ea667028..b018cbea 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,32 @@
+v47.1.1
+-------
+
+* #2156: Update mailing list pointer in developer docs
+
+Incorporate changes from v44.1.1:
+
+* #2158: Avoid loading working set during ``Distribution.finalize_options`` prior to invoking ``_install_setup_requires``, broken since v42.0.0.
+
+
+v44.1.1
+-------
+
+* #2158: Avoid loading working set during ``Distribution.finalize_options`` prior to invoking ``_install_setup_requires``, broken since v42.0.0.
+
+
+v47.1.0
+-------
+
+* #2070: In wheel-to-egg conversion, use simple pkg_resources-style namespace declaration for packages that declare namespace_packages.
+
+
+v47.0.0
+-------
+
+* #2094: Setuptools now actively crashes under Python 2. Python 3.5 or later is required. Users of Python 2 should use ``setuptools<45``.
+* #1700: Document all supported keywords by migrating the ones from distutils.
+
+
v46.4.0
-------
diff --git a/changelog.d/1700.change.rst b/changelog.d/1700.change.rst
deleted file mode 100644
index f66046a2..00000000
--- a/changelog.d/1700.change.rst
+++ /dev/null
@@ -1 +0,0 @@
-Document all supported keywords by migrating the ones from distutils.
diff --git a/docs/build_meta.txt b/docs/build_meta.txt
index ef9fb2ac..fcc2b7fe 100644
--- a/docs/build_meta.txt
+++ b/docs/build_meta.txt
@@ -68,7 +68,7 @@ Use ``setuptools``' `declarative config`_ to specify the package information::
Now generate the distribution. Although the PyPA is still working to
`provide a recommended tool <https://github.com/pypa/packaging-problems/issues/219>`_
-to build packages, the `pep517 package <https://pypi.org/project/pep517`_
+to build packages, the `pep517 package <https://pypi.org/project/pep517>`_
provides this functionality. To build the package::
$ pip install -q pep517
diff --git a/docs/developer-guide.txt b/docs/developer-guide.txt
index e6171e4e..4a78e22e 100644
--- a/docs/developer-guide.txt
+++ b/docs/developer-guide.txt
@@ -23,16 +23,16 @@ contribution.
Project Management
------------------
-Setuptools is maintained primarily in Github at `this home
+Setuptools is maintained primarily in GitHub at `this home
<https://github.com/pypa/setuptools>`_. Setuptools is maintained under the
Python Packaging Authority (PyPA) with several core contributors. All bugs
-for Setuptools are filed and the canonical source is maintained in Github.
+for Setuptools are filed and the canonical source is maintained in GitHub.
User support and discussions are done through the issue tracker (for specific)
-issues, through the distutils-sig mailing list, or on IRC (Freenode) at
+issues, through the `distutils-sig mailing list <https://mail.python.org/mailman3/lists/distutils-sig.python.org/>`_, or on IRC (Freenode) at
#pypa.
-Discussions about development happen on the pypa-dev mailing list or on
+Discussions about development happen on the distutils-sig mailing list or on
`Gitter <https://gitter.im/pypa/setuptools>`_.
-----------------
@@ -44,7 +44,7 @@ describing the motivation behind making changes. First search to see if a
ticket already exists for your issue. If not, create one. Try to think from
the perspective of the reader. Explain what behavior you expected, what you
got instead, and what factors might have contributed to the unexpected
-behavior. In Github, surround a block of code or traceback with the triple
+behavior. In GitHub, surround a block of code or traceback with the triple
backtick "\`\`\`" so that it is formatted nicely.
Filing a ticket provides a forum for justification, discussion, and
diff --git a/docs/pkg_resources.txt b/docs/pkg_resources.txt
index 71568c1a..f2e554f4 100644
--- a/docs/pkg_resources.txt
+++ b/docs/pkg_resources.txt
@@ -594,7 +594,7 @@ Requirements Parsing
FooProject >= 1.2
Fizzy [foo, bar]
- PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1
+ PickyThing>1.6,<=1.9,!=1.8.6
SomethingWhoseVersionIDontCareAbout
SomethingWithMarker[foo]>1.0;python_version<"2.7"
diff --git a/docs/python 2 sunset.txt b/docs/python 2 sunset.txt
new file mode 100644
index 00000000..f7b7ee25
--- /dev/null
+++ b/docs/python 2 sunset.txt
@@ -0,0 +1,69 @@
+:orphan:
+
+Python 2 Sunset
+===============
+
+Since January 2020 and the release of Setuptools 45, Python 2 is no longer
+supported by the most current release (`discussion
+<https://github.com/pypa/setuptools/issues/1458>`_). Setuptools as a project
+continues to support Python 2 with bugfixes and important features on
+Setuptools 44.x.
+
+By design, most users will be unaffected by this change. That's because
+Setuptools 45 declares its supported Python versions to exclude Python 2.7,
+and installers such as pip 9 or later will honor this declaration and prevent
+installation of Setuptools 45 or later in Python 2 environments.
+
+Users that do import any portion of Setuptools 45 or later on Python 2 are
+directed to this documentation to provide guidance on how to work around the
+issues.
+
+Workarounds
+-----------
+
+The best recommendation is to avoid Python 2 and move to Python 3 where
+possible. This project acknowledges that not all environments can drop Python
+2 support, so provides other options.
+
+In less common scenarios, later versions of Setuptools can be installed on
+unsupported Python versions. In these environments, the installer is advised
+to first install ``setuptools<45`` to "pin Setuptools" to a compatible
+version.
+
+- When using older versions of pip (before 9.0), the ``Requires-Python``
+ directive is not honored and invalid versions can be installed. Users are
+ advised first to upgrade pip and retry or to pin Setuptools. Use ``pip
+ --version`` to determine the version of pip.
+- When using ``easy_install``, ``Requires-Python`` is not honored and later
+ versions can be installed. In this case, users are advised to pin
+ Setuptools. This applies to ``setup.py install`` invocations as well, as
+ they use Setuptools under the hood.
+
+It's still not working
+----------------------
+
+If after trying the above steps, the Python environment still has incompatible
+versions of Setuptools installed, here are some things to try.
+
+1. Uninstall and reinstall Setuptools. Run ``pip uninstall -y setuptools`` for
+ the relevant environment. Repeat until there is no Setuptools installed.
+ Then ``pip install setuptools``.
+2. If possible, attempt to replicate the problem in a second environment
+ (virtual machine, friend's computer, etc). If the issue is isolated to just
+ one unique enviornment, first determine what is different about those
+ environments (or reinstall/reset the failing one to defaults).
+3. End users who are not themselves the maintainers for the package they are
+ trying to install should contact the support channels for the relevant
+ application. Please be considerate of those projects by searching for
+ existing issues and following the latest guidance before reaching out for
+ support. When filing an issue, be sure to give as much detail as possible
+ to help the maintainers understand what factors led to the issue after
+ following their recommended guidance.
+4. Reach out to your local support groups. There's a good chance someone
+ nearby has the expertise and willingness to help.
+5. If all else fails, `file this template
+ <https://github.com/pypa/setuptools/issues/new?assignees=&labels=Python+2&template=setuptools-warns-about-python-2-incompatibility.md&title=Incompatible+install+in+(summarize+your+environment)>`_
+ with Setuptools. Please complete the whole template, providing as much
+ detail about what factors led to the issue. Setuptools maintainers will
+ summarily close tickets filed without any meaningful detail or engagement
+ with the issue.
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index edd3d2e8..2e7d5059 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -1577,6 +1577,17 @@ is not allowed.
register_loader_type(object, NullProvider)
+def _parents(path):
+ """
+ yield all parents of path including path
+ """
+ last = None
+ while path != last:
+ yield path
+ last = path
+ path, _ = os.path.split(path)
+
+
class EggProvider(NullProvider):
"""Provider based on a virtual filesystem"""
@@ -1585,18 +1596,16 @@ class EggProvider(NullProvider):
self._setup_prefix()
def _setup_prefix(self):
- # we assume here that our metadata may be nested inside a "basket"
- # of multiple eggs; that's why we use module_path instead of .archive
- path = self.module_path
- old = None
- while path != old:
- if _is_egg_path(path):
- self.egg_name = os.path.basename(path)
- self.egg_info = os.path.join(path, 'EGG-INFO')
- self.egg_root = path
- break
- old = path
- path, base = os.path.split(path)
+ # Assume that metadata may be nested inside a "basket"
+ # of multiple eggs and use module_path instead of .archive.
+ eggs = filter(_is_egg_path, _parents(self.module_path))
+ egg = next(eggs, None)
+ egg and self._set_egg(egg)
+
+ def _set_egg(self, path):
+ self.egg_name = os.path.basename(path)
+ self.egg_info = os.path.join(path, 'EGG-INFO')
+ self.egg_root = path
class DefaultProvider(EggProvider):
diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py
index bfc35234..6855aa24 100644
--- a/pkg_resources/py2_warn.py
+++ b/pkg_resources/py2_warn.py
@@ -4,18 +4,13 @@ import textwrap
msg = textwrap.dedent("""
- You are running Setuptools on Python 2, which is no longer
- supported and
- >>> SETUPTOOLS WILL STOP WORKING <<<
- in a subsequent release (no sooner than 2020-04-20).
- Please ensure you are installing
- Setuptools using pip 9.x or later or pin to `setuptools<45`
- in your environment.
- If you have done those things and are still encountering
- this message, please follow up at
- https://bit.ly/setuptools-py2-warning.
+ Encountered a version of Setuptools that no longer supports
+ this version of Python. Please head to
+ https://bit.ly/setuptools-py2-sunset for support.
""")
-pre = "Setuptools will stop working on Python 2\n"
+pre = "Setuptools no longer works on Python 2\n"
-sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
+if sys.version_info < (3,):
+ warnings.warn(pre + "*" * 60 + msg + "*" * 60)
+ raise SystemExit(32)
diff --git a/setup.cfg b/setup.cfg
index 72d4dce9..66fb8921 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -16,7 +16,7 @@ formats = zip
[metadata]
name = setuptools
-version = 46.4.0
+version = 47.1.1
description = Easily download, build, install, upgrade, and uninstall Python packages
author = Python Packaging Authority
author_email = distutils-sig@python.org
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index 9df71a6d..7a1f9f4f 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -131,10 +131,27 @@ if PY3:
def _install_setup_requires(attrs):
# Note: do not use `setuptools.Distribution` directly, as
# our PEP 517 backend patch `distutils.core.Distribution`.
- dist = distutils.core.Distribution(dict(
- (k, v) for k, v in attrs.items()
- if k in ('dependency_links', 'setup_requires')
- ))
+ class MinimalDistribution(distutils.core.Distribution):
+ """
+ A minimal version of a distribution for supporting the
+ fetch_build_eggs interface.
+ """
+ def __init__(self, attrs):
+ _incl = 'dependency_links', 'setup_requires'
+ filtered = {
+ k: attrs[k]
+ for k in set(_incl) & set(attrs)
+ }
+ distutils.core.Distribution.__init__(self, filtered)
+
+ def finalize_options(self):
+ """
+ Disable finalize_options to avoid building the working set.
+ Ref #2158.
+ """
+
+ dist = MinimalDistribution(attrs)
+
# Honor setup.cfg's options.
dist.parse_config_files(ignore_option_errors=True)
if dist.setup_requires:
diff --git a/setuptools/wheel.py b/setuptools/wheel.py
index ec1106a7..ca09bd19 100644
--- a/setuptools/wheel.py
+++ b/setuptools/wheel.py
@@ -27,12 +27,8 @@ WHEEL_NAME = re.compile(
)\.whl$""",
re.VERBOSE).match
-NAMESPACE_PACKAGE_INIT = '''\
-try:
- __import__('pkg_resources').declare_namespace(__name__)
-except ImportError:
- __path__ = __import__('pkgutil').extend_path(__path__, __name__)
-'''
+NAMESPACE_PACKAGE_INIT = \
+ "__import__('pkg_resources').declare_namespace(__name__)\n"
def unpack(src_dir, dst_dir):
diff --git a/tox.ini b/tox.ini
index aa99e283..d3df21bf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -8,7 +8,7 @@ minversion = 3.2
requires =
tox-pip-version >= 0.0.6
# workaround for #1998
- virtualenv < 20
+ virtualenv < 20; python_version=="2.7"
[helpers]
# Custom pip behavior