mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
+29
-29
@@ -969,7 +969,6 @@ def do_lock(
|
||||
pypi_mirror=None,
|
||||
):
|
||||
"""Executes the freeze functionality."""
|
||||
from .utils import get_vcs_deps
|
||||
|
||||
cached_lockfile = {}
|
||||
if not pre:
|
||||
@@ -1931,38 +1930,39 @@ def do_install(
|
||||
extra_indexes=extra_index_url,
|
||||
pypi_mirror=pypi_mirror,
|
||||
)
|
||||
except (ValueError, RuntimeError):
|
||||
except (ValueError, RuntimeError) as e:
|
||||
sp.write_err(vistir.compat.fs_str("{0}: {1}".format(crayons.red("WARNING"), e)))
|
||||
sp.fail(environments.PIPENV_SPINNER_FAIL_TEXT.format("Installation Failed"))
|
||||
# Warn if --editable wasn't passed.
|
||||
if pkg_requirement.is_vcs and not pkg_requirement.editable:
|
||||
sp.write_err(
|
||||
"{0}: You installed a VCS dependency in non-editable mode. "
|
||||
"This will work fine, but sub-dependencies will not be resolved by {1}."
|
||||
"\n To enable this sub-dependency functionality, specify that this dependency is editable."
|
||||
"".format(
|
||||
crayons.red("Warning", bold=True),
|
||||
crayons.red("$ pipenv lock"),
|
||||
)
|
||||
)
|
||||
click.echo(crayons.blue(format_pip_output(c.out)))
|
||||
# Ensure that package was successfully installed.
|
||||
if c.return_code != 0:
|
||||
sp.write_err(vistir.compat.fs_str(
|
||||
"{0} An error occurred while installing {1}!".format(
|
||||
crayons.red("Error: ", bold=True), crayons.green(pkg_line)
|
||||
),
|
||||
))
|
||||
sp.write_err(vistir.compat.fs_str(crayons.blue(format_pip_error(c.err))))
|
||||
if "setup.py egg_info" in c.err:
|
||||
sp.write_err(vistir.compat.fs_str(
|
||||
"This is likely caused by a bug in {0}. "
|
||||
"Report this to its maintainers.".format(
|
||||
crayons.green(pkg_requirement.name)
|
||||
else:
|
||||
# Warn if --editable wasn't passed.
|
||||
if pkg_requirement.is_vcs and not pkg_requirement.editable:
|
||||
sp.write_err(
|
||||
"{0}: You installed a VCS dependency in non-editable mode. "
|
||||
"This will work fine, but sub-dependencies will not be resolved by {1}."
|
||||
"\n To enable this sub-dependency functionality, specify that this dependency is editable."
|
||||
"".format(
|
||||
crayons.red("Warning", bold=True),
|
||||
crayons.red("$ pipenv lock"),
|
||||
)
|
||||
)
|
||||
click.echo(crayons.blue(format_pip_output(c.out)))
|
||||
# Ensure that package was successfully installed.
|
||||
if c.return_code != 0:
|
||||
sp.write_err(vistir.compat.fs_str(
|
||||
"{0} An error occurred while installing {1}!".format(
|
||||
crayons.red("Error: ", bold=True), crayons.green(pkg_line)
|
||||
),
|
||||
))
|
||||
sp.fail(environments.PIPENV_SPINNER_FAIL_TEXT.format("Installation Failed"))
|
||||
sys.exit(1)
|
||||
sp.write_err(vistir.compat.fs_str(crayons.blue(format_pip_error(c.err))))
|
||||
if "setup.py egg_info" in c.err:
|
||||
sp.write_err(vistir.compat.fs_str(
|
||||
"This is likely caused by a bug in {0}. "
|
||||
"Report this to its maintainers.".format(
|
||||
crayons.green(pkg_requirement.name)
|
||||
)
|
||||
))
|
||||
sp.fail(environments.PIPENV_SPINNER_FAIL_TEXT.format("Installation Failed"))
|
||||
sys.exit(1)
|
||||
sp.write(vistir.compat.fs_str(
|
||||
u"{0} {1} {2} {3}{4}".format(
|
||||
crayons.normal(u"Adding", bold=True),
|
||||
|
||||
+5
-3
@@ -518,7 +518,7 @@ def venv_resolve_deps(
|
||||
dev=False,
|
||||
):
|
||||
from .vendor.vistir.misc import fs_str
|
||||
from .vendor.vistir.compat import Path, JSONDecodeError
|
||||
from .vendor.vistir.compat import Path, to_native_string, JSONDecodeError
|
||||
from .vendor.vistir.path import create_tracked_tempdir
|
||||
from . import resolver
|
||||
import json
|
||||
@@ -533,7 +533,7 @@ def venv_resolve_deps(
|
||||
vcs_section = "vcs_dev_packages" if dev else "vcs_packages"
|
||||
if getattr(project, vcs_section, []):
|
||||
with create_spinner(text=fs_str("Pinning VCS Packages...")) as sp:
|
||||
vcs_reqs, vcs_lockfile = get_vcs_deps(
|
||||
vcs_deps, vcs_lockfile = get_vcs_deps(
|
||||
project,
|
||||
which=which,
|
||||
clear=clear,
|
||||
@@ -541,7 +541,8 @@ def venv_resolve_deps(
|
||||
allow_global=allow_global,
|
||||
dev=dev,
|
||||
)
|
||||
vcs_deps = [req.as_line() for req in vcs_reqs if req.editable]
|
||||
vcs_deps = [req.as_line() for req in vcs_deps if req.editable]
|
||||
deps.extend([req.as_line() for req in vcs_deps if not req.editable])
|
||||
sp.write(environments.PIPENV_SPINNER_OK_TEXT.format(
|
||||
"Successfully pinned VCS Packages!"
|
||||
))
|
||||
@@ -569,6 +570,7 @@ def venv_resolve_deps(
|
||||
if vcs_deps:
|
||||
with temp_environ():
|
||||
os.environ["PIPENV_PACKAGES"] = str("\n".join(vcs_deps))
|
||||
sp.text = to_native_string("Locking VCS Dependencies...")
|
||||
vcs_c = resolve(cmd, sp)
|
||||
vcs_results, vcs_err = vcs_c.out, vcs_c.err
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user