Skip to content

Commit

Permalink
Merge branch 'master' into feature/deterministic-provides-extras
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco authored Sep 11, 2019
2 parents 7f7780e + cb64d3a commit b3ef77b
Show file tree
Hide file tree
Showing 34 changed files with 665 additions and 222 deletions.
7 changes: 7 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bumpversion]
current_version = 41.2.0
commit = True
tag = True

[bumpversion:file:setup.cfg]

12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dist: trusty
dist: xenial
language: python

jobs:
Expand All @@ -18,12 +18,11 @@ jobs:
python: 3.6
- &latest_py3
python: 3.7
dist: xenial
- <<: *latest_py3
env: LANG=C
- python: 3.8-dev
dist: xenial
env: DISABLE_COVERAGE=1 # Ignore invalid coverage data.
- <<: *latest_py3
env: TOXENV=docs DISABLE_COVERAGE=1
- <<: *default_py
stage: deploy (to PyPI for tagged commits)
if: tag IS present
Expand All @@ -38,9 +37,9 @@ jobs:
on:
tags: true
all_branches: true
user: jaraco
user: __token__
password:
secure: tfWrsQMH2bHrWjqnP+08IX1WlkbW94Q30f4d7lCyhWS1FIf/jBDx4jrEILNfMxQ1NCwuBRje5sihj1Ow0BFf0vVrkaeff2IdvnNDEGFduMejaEQJL3s3QrLfpiAvUbtqwyWaHfAdGfk48PovDKTx0ZTvXZKYGXZhxGCYSlG2CE6Y6RDvnEl6Tk8e+LqUohkcSOwxrRwUoyxSnUaavdGohXxDT8MJlfWOXgr2u+KsRrriZqp3l6Fdsnk4IGvy6pXpy42L1HYQyyVu9XyJilR2JTbC6eCp5f8p26093m1Qas49+t6vYb0VLqQe12dO+Jm3v4uztSS5pPQzS7PFyjEYd2Rdb6ijsdbsy1074S4q7G9Sz+T3RsPUwYEJ07lzez8cxP64dtj5j94RL8m35A1Fb1OE8hHN+4c1yLG1gudfXbem+fUhi2eqhJrzQo5vsvDv1xS5x5GIS5ZHgKHCsWcW1Tv+dsFkrhaup3uU6VkOuc9UN+7VPsGEY7NvquGpTm8O1CnGJRzuJg6nbYRGj8ORwDpI0KmrExx6akV92P72fMC/I5TCgbSQSZn370H3Jj40gz1SM30WAli9M+wFHFd4ddMVY65yxj0NLmrP+m1tvnWdKtNh/RHuoW92d9/UFtiA5IhMf1/3djfsjBq6S9NT1uaLkVkTttqrPYJ7hOql8+g=
secure: FSp9KU+pdvWPxBOaxe6BNmcJ9y8259G3/NdTJ00r0qx/xMLpSneGjpuLqoD6BL2JoM6gRwurwakWoH/9Ah+Di7afETjMnL6WJKtDZ+Uu3YLx3ss7/FlhVz6zmVTaDJUzuo9dGr//qLBQTIxVjGYfQelRJyfMAXtrYWdeT/4489E45lMw+86Z/vnSBOxs4lWekeQW5Gem0cDViWu67RRiGkAEvrYVwuImMr2Dyhpv+l/mQGQIS/ezXuAEFToE6+q8VUVe/aK498Qovdc+O4M7OYk1JouFpffZ3tVZ6iWHQFcR11480UdI6VCIcFpPvGC/J8MWUWLjq7YOm0X9jPXgdYMUQLAP4clFgUr2qNoRSKWfuQlNdVVuS2htYcjJ3eEl90FhcIZKp+WVMrypRPOQJ8CBielZEs0dhytRrZSaJC1BNq25O/BPzws8dL8hYtoXsM6I3Zv5cZgdyqyq/eOEMCX7Cetv6do0U41VGEV5UohvyyuwH5l9GCuPREpY3sXayPg8fw7XcPjvvzSVyjcUT/ePW8sfnAyWZnngjweAn6dK8IFGPuSPQdlos78uxeUOvCVUW0xv/0m4lX73yoHdVVdLbu1MJTyibFGec86Bew9JqIcDlhHaIJ9ihZ9Z9tOtvp1cuNyKYE4kvmOtumDDicEw4DseYn2z5sZDTYTBsKY=
distributions: release
skip_cleanup: true
skip_upload_docs: true
Expand All @@ -63,6 +62,7 @@ install:
- "! grep pyc setuptools.egg-info/SOURCES.txt"

script:
- export NETWORK_REQUIRED=1
- |
( # Run testsuite.
if [ -z "$DISABLE_COVERAGE" ]
Expand Down
55 changes: 50 additions & 5 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
v41.2.0
-------

* #479: Remove some usage of the deprecated ``imp`` module.
* #1565: Changed html_sidebars from string to list of string as per
https://www.sphinx-doc.org/en/master/changes.html#id58


v41.1.0
-------

* #1697: Moved most of the constants from setup.py to setup.cfg
* #1749: Fixed issue with the PEP 517 backend where building a source distribution would fail if any tarball existed in the destination directory.
* #1750: Fixed an issue with PEP 517 backend where wheel builds would fail if the destination directory did not already exist.
* #1756: Force metadata-version >= 1.2. when project urls are present.
* #1769: Improve ``package_data`` check: ensure the dictionary values are lists/tuples of strings.
* #1788: Changed compatibility fallback logic for ``html.unescape`` to avoid accessing ``HTMLParser.unescape`` when not necessary. ``HTMLParser.unescape`` is deprecated and will be removed in Python 3.9.
* #1790: Added the file path to the error message when a ``UnicodeDecodeError`` occurs while reading a metadata file.
* #1776: Use license classifiers rather than the license field.


v41.0.1
-------

* #1671: Fixed issue with the PEP 517 backend that prevented building a wheel when the ``dist/`` directory contained existing ``.whl`` files.
* #1709: In test.paths_on_python_path, avoid adding unnecessary duplicates to the PYTHONPATH.
* #1741: In package_index, now honor "current directory" during a checkout of git and hg repositories under Windows


v41.0.0
-------

* #1735: When parsing setup.cfg files, setuptools now requires the files to be encoded as UTF-8. Any other encoding will lead to a UnicodeDecodeError. This change removes support for specifying an encoding using a 'coding: ' directive in the header of the file, a feature that was introduces in 40.7. Given the recent release of the aforementioned feature, it is assumed that few if any projects are utilizing the feature to specify an encoding other than UTF-8.


v40.9.0
-------

* #1675: Added support for ``setup.cfg``-only projects when using the ``setuptools.build_meta`` backend. Projects that have enabled PEP 517 no longer need to have a ``setup.py`` and can use the purely declarative ``setup.cfg`` configuration file instead.
* #1720: Added support for ``pkg_resources.parse_requirements``-style requirements in ``setup_requires`` when ``setup.py`` is invoked from the ``setuptools.build_meta`` build backend.
* #1664: Added the path to the ``PKG-INFO`` or ``METADATA`` file in the exception
text when the ``Version:`` header can't be found.
* #1705: Removed some placeholder documentation sections referring to deprecated features.


v40.8.0
-------

Expand Down Expand Up @@ -1480,8 +1525,8 @@ v20.6.0
19.7
----

* `Off-project PR <https://github.com/jaraco/setuptools/pull/32>`_:
For FreeBSD, also honor root certificates from ca_root_nss.
* Off-project PR: `0dcee79 <https://github.com/pypa/setuptools/commit/0dcee791dfdcfacddaaec79b29f30a347a147413>`_ and `f9bd9b9 <https://github.com/pypa/setuptools/commit/f9bd9b9f5df54ef5a0bf8d16c3a889ab8c640580>`_
For FreeBSD, also `honor root certificates from ca_root_nss <https://github.com/pypa/setuptools/commit/3ae46c30225eb46e1f5aada1a19e88b79f04dc72>`_.

19.6.2
------
Expand Down Expand Up @@ -1645,9 +1690,9 @@ v20.6.0
now logged when pkg_resources is imported on Python 3.2 or earlier
Python 3 versions.
* `Add support for python_platform_implementation environment marker
<https://github.com/jaraco/setuptools/pull/28>`_.
<https://github.com/pypa/setuptools/commit/94416707fd59a65f4a8f7f70541d6b3fc018b626>`_.
* `Fix dictionary mutation during iteration
<https://github.com/jaraco/setuptools/pull/29>`_.
<https://github.com/pypa/setuptools/commit/57ebfa41e0f96b97e599ecd931b7ae8a143e096e>`_.

18.4
----
Expand Down Expand Up @@ -2007,7 +2052,7 @@ process to fail and PyPI uploads no longer accept files for 13.0.
---

* Prefer vendored packaging library `as recommended
<https://github.com/jaraco/setuptools/commit/170657b68f4b92e7e1bf82f5e19a831f5744af67#commitcomment-9109448>`_.
<https://github.com/pypa/setuptools/commit/170657b68f4b92e7e1bf82f5e19a831f5744af67>`_.

9.0.1
-----
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ Bug reports and especially tested patches may be
submitted directly to the `bug tracker
<https://github.com/pypa/setuptools/issues>`_.

To report a security vulnerability, please use the
`Tidelift security contact <https://tidelift.com/security>`_.
Tidelift will coordinate the fix and disclosure.


Code of Conduct
---------------
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ clone_depth: 50
environment:

APPVEYOR: True
NETWORK_REQUIRED: True
CODECOV_ENV: APPVEYOR_JOB_NAME

matrix:
Expand All @@ -25,7 +26,7 @@ cache:
test_script:
- python --version
- python -m pip install --disable-pip-version-check --upgrade pip setuptools wheel
- pip install --upgrade tox tox-venv
- pip install --upgrade tox tox-venv virtualenv
- pip freeze --all
- python bootstrap.py
- tox -- --cov
Expand Down
1 change: 0 additions & 1 deletion changelog.d/1675.change.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {'index': 'indexsidebar.html'}
html_sidebars = {'index': ['relations.html', 'sourcelink.html', 'indexsidebar.html', 'searchbox.html']}

# If false, no module index is generated.
html_use_modindex = False
Expand Down
14 changes: 14 additions & 0 deletions docs/developer-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,17 @@ To build the docs locally, use tox::

.. _Sphinx: http://www.sphinx-doc.org/en/master/
.. _published documentation: https://setuptools.readthedocs.io/en/latest/

---------------------
Vendored Dependencies
---------------------

Setuptools has some dependencies, but due to `bootstrapping issues
<https://github.com/pypa/setuptools/issues/980>`, those dependencies
cannot be declared as they won't be resolved soon enough to build
setuptools from source. Eventually, this limitation may be lifted as
PEP 517/518 reach ubiquitous adoption, but for now, Setuptools
cannot declare dependencies other than through
``setuptools/_vendor/vendored.txt`` and
``pkg_reosurces/_vendor/vendored.txt`` and refreshed by way of
``paver update_vendored`` (pavement.py).
45 changes: 6 additions & 39 deletions docs/setuptools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,18 @@ dependencies, and perhaps some data files and scripts::
author="Me",
author_email="[email protected]",
description="This is an Example Package",
license="PSF",
keywords="hello world example examples",
url="http://example.com/HelloWorld/", # project home page, if any
project_urls={
"Bug Tracker": "https://bugs.example.com/HelloWorld/",
"Documentation": "https://docs.example.com/HelloWorld/",
"Source Code": "https://code.example.com/HelloWorld/",
}
},
classifiers=[
'License :: OSI Approved :: Python Software Foundation License'
]

# could also include long_description, download_url, classifiers, etc.
# could also include long_description, download_url, etc.
)

In the sections that follow, we'll explain what most of these ``setup()``
Expand Down Expand Up @@ -2234,6 +2236,7 @@ boilerplate code in some cases.
license = BSD 3-Clause License
classifiers =
Framework :: Django
License :: OSI Approved :: BSD License
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5

Expand Down Expand Up @@ -2679,42 +2682,6 @@ A few important points for writing revision control file finders:
inform the user of the missing program(s).


Subclassing ``Command``
-----------------------

Sorry, this section isn't written yet, and neither is a lot of what's below
this point.

XXX


Reusing ``setuptools`` Code
===========================

``ez_setup``
------------

XXX


``setuptools.archive_util``
---------------------------

XXX


``setuptools.sandbox``
----------------------

XXX


``setuptools.package_index``
----------------------------

XXX


Mailing List and Bug Tracker
============================

Expand Down
1 change: 1 addition & 0 deletions launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <windows.h>
#include <tchar.h>
#include <fcntl.h>
#include <process.h>

int child_pid=0;

Expand Down
60 changes: 53 additions & 7 deletions pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,14 +1403,30 @@ def get_resource_string(self, manager, resource_name):
def has_resource(self, resource_name):
return self._has(self._fn(self.module_path, resource_name))

def _get_metadata_path(self, name):
return self._fn(self.egg_info, name)

def has_metadata(self, name):
return self.egg_info and self._has(self._fn(self.egg_info, name))
if not self.egg_info:
return self.egg_info

path = self._get_metadata_path(name)
return self._has(path)

def get_metadata(self, name):
if not self.egg_info:
return ""
value = self._get(self._fn(self.egg_info, name))
return value.decode('utf-8') if six.PY3 else value
path = self._get_metadata_path(name)
value = self._get(path)
if six.PY2:
return value
try:
return value.decode('utf-8')
except UnicodeDecodeError as exc:
# Include the path in the error message to simplify
# troubleshooting, and without changing the exception type.
exc.reason += ' in {} file at path: {}'.format(name, path)
raise

def get_metadata_lines(self, name):
return yield_lines(self.get_metadata(name))
Expand Down Expand Up @@ -1868,6 +1884,9 @@ class FileMetadata(EmptyProvider):
def __init__(self, path):
self.path = path

def _get_metadata_path(self, name):
return self.path

def has_metadata(self, name):
return name == 'PKG-INFO' and os.path.isfile(self.path)

Expand Down Expand Up @@ -2661,10 +2680,14 @@ def version(self):
try:
return self._version
except AttributeError:
version = _version_from_file(self._get_metadata(self.PKG_INFO))
version = self._get_version()
if version is None:
tmpl = "Missing 'Version:' header and/or %s file"
raise ValueError(tmpl % self.PKG_INFO, self)
path = self._get_metadata_path_for_display(self.PKG_INFO)
msg = (
"Missing 'Version:' header and/or {} file at path: {}"
).format(self.PKG_INFO, path)
raise ValueError(msg, self)

return version

@property
Expand Down Expand Up @@ -2722,11 +2745,34 @@ def requires(self, extras=()):
)
return deps

def _get_metadata_path_for_display(self, name):
"""
Return the path to the given metadata file, if available.
"""
try:
# We need to access _get_metadata_path() on the provider object
# directly rather than through this class's __getattr__()
# since _get_metadata_path() is marked private.
path = self._provider._get_metadata_path(name)

# Handle exceptions e.g. in case the distribution's metadata
# provider doesn't support _get_metadata_path().
except Exception:
return '[could not detect]'

return path

def _get_metadata(self, name):
if self.has_metadata(name):
for line in self.get_metadata_lines(name):
yield line

def _get_version(self):
lines = self._get_metadata(self.PKG_INFO)
version = _version_from_file(lines)

return version

def activate(self, path=None, replace=False):
"""Ensure distribution is importable on `path` (default=sys.path)"""
if path is None:
Expand Down Expand Up @@ -2945,7 +2991,7 @@ def _reload_version(self):
take an extra step and try to get the version number from
the metadata file itself instead of the filename.
"""
md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
md_version = self._get_version()
if md_version:
self._version = md_version
return self
Expand Down
Loading

0 comments on commit b3ef77b

Please sign in to comment.