diff --git a/news/4837.vendor.rst b/news/4837.vendor.rst new file mode 100644 index 0000000000..6404c1d5a4 --- /dev/null +++ b/news/4837.vendor.rst @@ -0,0 +1 @@ +Update ``pythonfinder`` from ``1.2.8`` to ``1.2.9``. diff --git a/pipenv/vendor/pythonfinder/LICENSE.txt b/pipenv/vendor/pythonfinder/LICENSE.txt new file mode 100644 index 0000000000..4715db36be --- /dev/null +++ b/pipenv/vendor/pythonfinder/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) 2018 Dan Ryan + +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. diff --git a/pipenv/vendor/pythonfinder/__init__.py b/pipenv/vendor/pythonfinder/__init__.py index 326a655ff1..7ff28b14bd 100644 --- a/pipenv/vendor/pythonfinder/__init__.py +++ b/pipenv/vendor/pythonfinder/__init__.py @@ -10,7 +10,7 @@ from .models import SystemPath, WindowsFinder from .pythonfinder import Finder -__version__ = "1.2.8" +__version__ = "1.2.9" logger = logging.getLogger(__name__) diff --git a/pipenv/vendor/pythonfinder/models/python.py b/pipenv/vendor/pythonfinder/models/python.py index d001a1e59f..3c2a13deed 100644 --- a/pipenv/vendor/pythonfinder/models/python.py +++ b/pipenv/vendor/pythonfinder/models/python.py @@ -3,6 +3,7 @@ import logging import operator +import os import platform import sys from collections import defaultdict @@ -133,6 +134,8 @@ def get_bin_dir(self, base): # type: (Union[Path, str]) -> Path if isinstance(base, six.string_types): base = Path(base) + if os.name == "nt": + return base return base / "bin" @classmethod @@ -451,9 +454,9 @@ def matches( if arch.isdigit(): arch = "{0}bit".format(arch) if ( - (major is None or self.major and self.major == major) - and (minor is None or self.minor and self.minor == minor) - and (patch is None or self.patch and self.patch == patch) + (major is None or self.major == major) + and (minor is None or self.minor == minor) + and (patch is None or self.patch == patch) and (pre is None or self.is_prerelease == pre) and (dev is None or self.is_devrelease == dev) and (arch is None or own_arch == arch) diff --git a/pipenv/vendor/pythonfinder/models/windows.py b/pipenv/vendor/pythonfinder/models/windows.py index fb36a27239..794a881c2b 100644 --- a/pipenv/vendor/pythonfinder/models/windows.py +++ b/pipenv/vendor/pythonfinder/models/windows.py @@ -92,6 +92,8 @@ def get_versions(self): path = ensure_path(install_path.__getattr__("")) except AttributeError: continue + if not path.exists(): + continue try: py_version = PythonVersion.from_windows_launcher( version_object, name=name, company=company diff --git a/pipenv/vendor/pythonfinder/utils.py b/pipenv/vendor/pythonfinder/utils.py index c3db72615a..0ccb34270e 100644 --- a/pipenv/vendor/pythonfinder/utils.py +++ b/pipenv/vendor/pythonfinder/utils.py @@ -62,7 +62,7 @@ KNOWN_EXTS = KNOWN_EXTS | set( filter(None, os.environ.get("PATHEXT", "").split(os.pathsep)) ) -PY_MATCH_STR = r"((?P{0})(?:\d?(?:\.\d[cpm]{{0,3}}))?(?:-?[\d\.]+)*)".format( +PY_MATCH_STR = r"((?P{0})(?:\d?(?:\.\d[cpm]{{0,3}}))?(?:-?[\d\.]+)*(?!w))".format( "|".join(PYTHON_IMPLEMENTATIONS) ) EXE_MATCH_STR = r"{0}(?:\.(?P{1}))?".format(PY_MATCH_STR, "|".join(KNOWN_EXTS)) diff --git a/pipenv/vendor/vendor.txt b/pipenv/vendor/vendor.txt index ad73c48d6f..664c531f26 100644 --- a/pipenv/vendor/vendor.txt +++ b/pipenv/vendor/vendor.txt @@ -35,7 +35,7 @@ ptyprocess==0.7.0 pyparsing==2.4.7 python-dateutil==2.8.2 python-dotenv==0.19.0 -pythonfinder==1.2.8 +pythonfinder==1.2.9 requests==2.26.0 requirementslib==1.6.1 shellingham==1.4.0