Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vendor libraries #4302

Merged
merged 5 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update requirementslib
  • Loading branch information
frostming committed Jun 1, 2020
commit c5d2129e2bd91318d4e1c34b872f2cf63d8741c9
54 changes: 54 additions & 0 deletions pipenv/vendor/python-dateutil.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Copyright 2017- Paul Ganssle <paul@ganssle.io>
Copyright 2017- dateutil contributors (see AUTHORS file)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

The above license applies to all contributions after 2017-12-01, as well as
all contributions that have been re-licensed (see AUTHORS file for the list of
contributors who have re-licensed their code).
--------------------------------------------------------------------------------
dateutil - Extensions to the standard Python datetime module.

Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
Copyright (c) 2012-2014 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
Copyright (c) 2014-2016 - Yaron de Leeuw <me@jarondl.net>
Copyright (c) 2015- - Paul Ganssle <paul@ganssle.io>
Copyright (c) 2015- - dateutil contributors (see AUTHORS file)

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The above BSD License Applies to all code, even that also covered by Apache 2.0.
2 changes: 1 addition & 1 deletion pipenv/vendor/requirementslib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .models.pipfile import Pipfile
from .models.requirements import Requirement

__version__ = "1.5.9"
__version__ = "1.5.10"


logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion pipenv/vendor/requirementslib/models/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def _parse_name_from_path(self):
parsed_setup_py = self.parsed_setup_py
if parsed_setup_py:
name = parsed_setup_py.get("name", "")
if name:
if name and isinstance(name, six.string_types):
return name
return None

Expand Down
49 changes: 24 additions & 25 deletions pipenv/vendor/requirementslib/models/setup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,21 +469,18 @@ def iter_metadata(path, pkg_name=None, metadata_type="egg-info"):
# type: (AnyStr, Optional[AnyStr], AnyStr) -> Generator
if pkg_name is not None:
pkg_variants = get_name_variants(pkg_name)
non_matching_dirs = []
with contextlib.closing(ScandirCloser(path)) as path_iterator:
for entry in path_iterator:
if entry.is_dir():
entry_name, ext = os.path.splitext(entry.name)
if ext.endswith(metadata_type):
if pkg_name is None or entry_name.lower() in pkg_variants:
yield entry
elif not entry.name.endswith(metadata_type):
non_matching_dirs.append(entry)
for entry in non_matching_dirs:
for dir_entry in iter_metadata(
entry.path, pkg_name=pkg_name, metadata_type=metadata_type
):
yield dir_entry
dirs_to_search = [path]
while dirs_to_search:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

glad to get this merged, so much nesting though!

p = dirs_to_search.pop(0)
with contextlib.closing(ScandirCloser(p)) as path_iterator:
for entry in path_iterator:
if entry.is_dir():
entry_name, ext = os.path.splitext(entry.name)
if ext.endswith(metadata_type):
if pkg_name is None or entry_name.lower() in pkg_variants:
yield entry
elif not entry.name.endswith(metadata_type):
dirs_to_search.append(entry.path)


def find_egginfo(target, pkg_name=None):
Expand Down Expand Up @@ -729,14 +726,16 @@ def unmap_binops(self):
self.binOps_map[binop] = ast_unparse(binop, analyzer=self)

def match_assignment_str(self, match):
return next(
iter(k for k in self.assignments if getattr(k, "id", "") == match), None
)
matches = [k for k in self.assignments if getattr(k, "id", "") == match]
if matches:
return matches[-1]
return None

def match_assignment_name(self, match):
return next(
iter(k for k in self.assignments if getattr(k, "id", "") == match.id), None
)
matches = [k for k in self.assignments if getattr(k, "id", "") == match.id]
if matches:
return matches[-1]
return None

def generic_unparse(self, item):
if any(isinstance(item, k) for k in AST_BINOP_MAP.keys()):
Expand Down Expand Up @@ -771,7 +770,7 @@ def unparse_Subscript(self, item):
if isinstance(item.slice, ast.Index):
try:
unparsed = unparsed[self.unparse(item.slice.value)]
except KeyError:
except (KeyError, TypeError):
# not everything can be looked up before runtime
unparsed = item
return unparsed
Expand Down Expand Up @@ -838,7 +837,7 @@ def unparse_Compare(self, item):
if isinstance(item.left, ast.Attribute) or isinstance(item.left, ast.Str):
import importlib

left = unparse(item.left)
left = self.unparse(item.left)
if "." in left:
name, _, val = left.rpartition(".")
left = getattr(importlib.import_module(name), val, left)
Expand Down Expand Up @@ -1002,7 +1001,7 @@ def ast_unparse(item, initial_mapping=False, analyzer=None, recurse=True): # no
if isinstance(item.slice, ast.Index):
try:
unparsed = unparsed[unparse(item.slice.value)]
except KeyError:
except (KeyError, TypeError):
# not everything can be looked up before runtime
unparsed = item
elif any(isinstance(item, k) for k in AST_BINOP_MAP.keys()):
Expand Down Expand Up @@ -1848,7 +1847,7 @@ def from_ireq(cls, ireq, subdir=None, finder=None, session=None):
is_vcs = True if vcs else is_artifact_or_vcs
if is_file and not is_vcs and path is not None and os.path.isdir(path):
target = os.path.join(kwargs["src_dir"], os.path.basename(path))
shutil.copytree(path, target)
shutil.copytree(path, target, symlinks=True)
ireq.source_dir = target
if not (ireq.editable and is_file and is_vcs):
if ireq.is_wheel:
Expand Down
18 changes: 9 additions & 9 deletions pipenv/vendor/requirementslib/models/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pipenv.vendor import attr
import pip_shims.shims
from orderedmultidict import omdict
from six.moves.urllib.parse import quote_plus, unquote_plus
from six.moves.urllib.parse import quote, unquote_plus, unquote as url_unquote
from urllib3 import util as urllib3_util
from urllib3.util import parse_url as urllib3_parse
from urllib3.util.url import Url
Expand Down Expand Up @@ -42,8 +42,8 @@ def _get_parsed_url(url):
auth, _, url = url.rpartition("@")
url = "{scheme}://{url}".format(scheme=scheme, url=url)
parsed = urllib3_parse(url)._replace(auth=auth)
if parsed.auth and unquote_plus(parsed.auth) != parsed.auth:
return parsed._replace(auth=unquote_plus(parsed.auth))
if parsed.auth:
return parsed._replace(auth=url_unquote(parsed.auth))
return parsed


Expand Down Expand Up @@ -110,7 +110,7 @@ def _parse_query(self):
subdirectory = self.subdirectory if self.subdirectory else None
for q in queries:
key, _, val = q.partition("=")
val = unquote_plus(val.replace("+", " "))
val = unquote_plus(val)
if key == "subdirectory" and not subdirectory:
subdirectory = val
else:
Expand All @@ -132,7 +132,7 @@ def _parse_fragment(self):
extras = self.extras
for q in fragments:
key, _, val = q.partition("=")
val = unquote_plus(val.replace("+", " "))
val = unquote_plus(val)
fragment_items[key] = val
if key == "egg":
from .utils import parse_extras
Expand All @@ -158,10 +158,10 @@ def _parse_auth(self):
username_is_quoted, password_is_quoted = False, False
quoted_username, quoted_password = "", ""
if password:
quoted_password = quote_plus(password)
quoted_password = quote(password)
password_is_quoted = quoted_password != password
if username:
quoted_username = quote_plus(username)
quoted_username = quote(username)
username_is_quoted = quoted_username != username
return attr.evolve(
self,
Expand All @@ -176,14 +176,14 @@ def get_password(self, unquote=False, include_token=True):
# type: (bool, bool) -> str
password = self.password if self.password else ""
if password and unquote and self._password_is_quoted:
password = unquote_plus(password)
password = url_unquote(password)
return password

def get_username(self, unquote=False):
# type: (bool) -> str
username = self.username if self.username else ""
if username and unquote and self._username_is_quoted:
username = unquote_plus(username)
username = url_unquote(username)
return username

@staticmethod
Expand Down
27 changes: 27 additions & 0 deletions pipenv/vendor/toml/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The MIT License

Copyright 2013-2019 William Pearson
Copyright 2015-2016 Julien Enselme
Copyright 2016 Google Inc.
Copyright 2017 Samuel Vasko
Copyright 2017 Nate Prewitt
Copyright 2017 Jack Evans
Copyright 2019 Filippo Broggini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
6 changes: 3 additions & 3 deletions pipenv/vendor/vendor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ pipdeptree==0.13.2
pipreqs==0.4.10
docopt==0.6.2
yarg==0.1.9
pythonfinder==1.2.2
pythonfinder==1.2.3
requests==2.23.0
chardet==3.0.4
idna==2.9
urllib3==1.25.9
certifi==2020.4.5.1
requirementslib==1.5.9
requirementslib==1.5.10
attrs==19.3.0
distlib==0.3.0
packaging==20.3
pyparsing==2.4.7
git+https://github.com/sarugaku/plette.git@master#egg=plette
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the release in sync with master now? that's nice to know anyhow

plette==0.2.3
tomlkit==0.5.11
shellingham==1.3.2
six==1.14.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ index 3d5743e6..b0c98de8 100644
+from pipenv.vendor import attr
import pip_shims.shims
from orderedmultidict import omdict
from six.moves.urllib.parse import quote_plus, unquote_plus
from six.moves.urllib.parse import quote, unquote_plus, unquote as url_unquote
diff --git a/pipenv/vendor/requirementslib/models/vcs.py b/pipenv/vendor/requirementslib/models/vcs.py
index 0f96a331..273305db 100644
--- a/pipenv/vendor/requirementslib/models/vcs.py
Expand Down