From 089bb57d7e514df102a23bcdb1f48d7d4e815133 Mon Sep 17 00:00:00 2001 From: frostming Date: Wed, 17 Jul 2019 12:21:11 +0800 Subject: [PATCH 1/2] Update vendor packages --- pipenv/vendor/pythonfinder/utils.py | 5 ++++- pipenv/vendor/requirementslib/models/setup_info.py | 8 +++++--- pipenv/vendor/requirementslib/models/utils.py | 4 +++- tasks/release.py | 2 ++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pipenv/vendor/pythonfinder/utils.py b/pipenv/vendor/pythonfinder/utils.py index 477f366860..1c190b0148 100644 --- a/pipenv/vendor/pythonfinder/utils.py +++ b/pipenv/vendor/pythonfinder/utils.py @@ -58,7 +58,10 @@ "pyston", "micropython", ) -KNOWN_EXTS = {"exe", "py", "fish", "sh", ""} +if os.name == "nt": + KNOWN_EXTS = {"exe", "py", "bat", ""} +else: + KNOWN_EXTS = {"sh", "bash", "csh", "zsh", "fish", "py", ""} KNOWN_EXTS = KNOWN_EXTS | set( filter(None, os.environ.get("PATHEXT", "").split(os.pathsep)) ) diff --git a/pipenv/vendor/requirementslib/models/setup_info.py b/pipenv/vendor/requirementslib/models/setup_info.py index 551f3e878d..3bee49ea98 100644 --- a/pipenv/vendor/requirementslib/models/setup_info.py +++ b/pipenv/vendor/requirementslib/models/setup_info.py @@ -28,6 +28,8 @@ from vistir.misc import run from vistir.path import create_tracked_tempdir, ensure_mkdir_p, mkdir_p, rmtree +from ..environment import MYPY_RUNNING +from ..exceptions import RequirementError from .utils import ( get_default_pyproject_backend, get_name_variants, @@ -37,8 +39,6 @@ split_vcs_method_from_uri, strip_extras_markers_from_requirement, ) -from ..environment import MYPY_RUNNING -from ..exceptions import RequirementError try: from setuptools.dist import distutils, Distribution @@ -712,11 +712,13 @@ def ast_unparse(item, initial_mapping=False, analyzer=None, recurse=True): # no item.right = right_item unparsed = item else: - unparsed = right_item + left_item + unparsed = left_item + right_item else: unparsed = item elif isinstance(item.op, ast.Sub): unparsed = unparse(item.left) - unparse(item.right) + else: + unparsed = item elif isinstance(item, ast.Name): if not initial_mapping: unparsed = item.id diff --git a/pipenv/vendor/requirementslib/models/utils.py b/pipenv/vendor/requirementslib/models/utils.py index 4b4979549d..e79ea7e959 100644 --- a/pipenv/vendor/requirementslib/models/utils.py +++ b/pipenv/vendor/requirementslib/models/utils.py @@ -505,7 +505,9 @@ def split_markers_from_line(line): # type: (AnyStr) -> Tuple[AnyStr, Optional[AnyStr]] """Split markers from a dependency""" quote_chars = ["'", '"'] - line_quote = next(iter(quote for quote in quote_chars if line.startswith(quote)), None) + line_quote = next( + iter(quote for quote in quote_chars if line.startswith(quote)), None + ) if line_quote and line.endswith(line_quote): line = line.strip(line_quote) if not any(line.startswith(uri_prefix) for uri_prefix in SCHEME_LIST): diff --git a/tasks/release.py b/tasks/release.py index 5b87a76a80..610a36a922 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -82,6 +82,7 @@ def release(ctx, dry_run=False): ctx.run("towncrier --draft > CHANGELOG.draft.rst") log("would remove: news/*") log("would remove: CHANGELOG.draft.rst") + log("would update: pipenv/pipenv.1") log(f'Would commit with message: "Release v{version}"') else: ctx.run("towncrier") @@ -90,6 +91,7 @@ def release(ctx, dry_run=False): ) ctx.run("git rm CHANGELOG.draft.rst") generate_manual(ctx) + ctx.run("git add pipenv/pipenv.1") ctx.run(f'git commit -m "Release v{version}"') tag_content = tag_content.replace('"', '\\"') From 529ba1611de38af94fe8c174471f4f8d4b52b116 Mon Sep 17 00:00:00 2001 From: frostming Date: Wed, 17 Jul 2019 12:25:50 +0800 Subject: [PATCH 2/2] Add news --- news/3807.bugfix.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 news/3807.bugfix.rst diff --git a/news/3807.bugfix.rst b/news/3807.bugfix.rst new file mode 100644 index 0000000000..6330c6bce9 --- /dev/null +++ b/news/3807.bugfix.rst @@ -0,0 +1,2 @@ +Update ``pythonfinder`` to fix a problem that ``python.exe`` will be mistakenly chosen for +virtualenv creation under WSL.