mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #4421 from pypa/bugfix/4403
Do not copy project tree
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Do not copy the whole directory tree of local file package.
|
||||
@@ -0,0 +1,2 @@
|
||||
* Update ``requirements`` to ``1.`5.13``.
|
||||
* Update ``pip-shims`` to ``0.5.3``.
|
||||
+2
-3
@@ -823,8 +823,8 @@ def do_install_dependencies(
|
||||
click.echo(
|
||||
crayons.normal(fix_utf8("Installing dependencies from Pipfile…"), bold=True)
|
||||
)
|
||||
# skip_lock should completely bypass the lockfile (broken in 4dac1676)
|
||||
lockfile = project.get_or_create_lockfile(from_pipfile=True)
|
||||
# skip_lock should completely bypass the lockfile (broken in 4dac1676)
|
||||
lockfile = project.get_or_create_lockfile(from_pipfile=True)
|
||||
else:
|
||||
lockfile = project.get_or_create_lockfile()
|
||||
if not bare:
|
||||
@@ -851,7 +851,6 @@ def do_install_dependencies(
|
||||
"\n".join(sorted(deps))
|
||||
)
|
||||
sys.exit(0)
|
||||
|
||||
if concurrent:
|
||||
nprocs = PIPENV_MAX_SUBPROCESS
|
||||
else:
|
||||
|
||||
Vendored
+1
-1
@@ -25,7 +25,7 @@ import sys
|
||||
|
||||
from . import shims
|
||||
|
||||
__version__ = "0.5.2"
|
||||
__version__ = "0.5.3"
|
||||
|
||||
|
||||
if "pip_shims" in sys.modules:
|
||||
|
||||
Vendored
+10
-10
@@ -720,7 +720,7 @@ def shim_unpack(
|
||||
:type unpack_fn: Callable
|
||||
:param str download_dir: The directory to download the file to
|
||||
:param TShimmedFunc tempdir_manager_provider: A callable or shim referring to
|
||||
`global_tempdir_manager` function from pipenv.patched.notpip or a shimmed no-op context manager
|
||||
`global_tempdir_manager` function from pip or a shimmed no-op context manager
|
||||
:param Optional[:class:`~pip._internal.req.req_install.InstallRequirement`] ireq:
|
||||
an Install Requirement instance, defaults to None
|
||||
:param Optional[:class:`~pip._internal.models.link.Link`] link: A Link instance,
|
||||
@@ -904,13 +904,9 @@ def make_preparer(
|
||||
if options is not None and pip_options_created:
|
||||
for k, v in options_map.items():
|
||||
suppress_setattr(options, k, v, filter_none=True)
|
||||
if all([session is None, install_cmd is None, session_is_required]):
|
||||
raise TypeError(
|
||||
"Preparer requires a session instance which was not supplied and cannot be "
|
||||
"created without an InstallCommand."
|
||||
)
|
||||
elif all([session is None, session_is_required]):
|
||||
session = get_session(install_cmd=install_cmd, options=options)
|
||||
if session_is_required:
|
||||
if session is None:
|
||||
session = get_session(install_cmd=install_cmd, options=options)
|
||||
preparer_args["session"] = session
|
||||
if finder_is_required:
|
||||
finder = _ensure_finder(
|
||||
@@ -928,7 +924,7 @@ def make_preparer(
|
||||
if "req_tracker" in required_args:
|
||||
req_tracker = tracker_ctx if req_tracker is None else req_tracker
|
||||
preparer_args["req_tracker"] = req_tracker
|
||||
|
||||
preparer_args["lazy_wheel"] = True
|
||||
result = call_function_with_correct_args(preparer_fn, **preparer_args)
|
||||
yield result
|
||||
|
||||
@@ -1318,7 +1314,11 @@ def resolve( # noqa:C901
|
||||
wheel_cache_provider(kwargs["cache_dir"], format_control)
|
||||
) # type: ignore
|
||||
ireq.is_direct = True # type: ignore
|
||||
build_location_kwargs = {"build_dir": kwargs["build_dir"], "autodelete": True}
|
||||
build_location_kwargs = {
|
||||
"build_dir": kwargs["build_dir"],
|
||||
"autodelete": True,
|
||||
"parallel_builds": False
|
||||
}
|
||||
call_function_with_correct_args(ireq.build_location, **build_location_kwargs)
|
||||
if reqset_provider is None:
|
||||
raise TypeError(
|
||||
|
||||
Vendored
+11
-18
@@ -441,27 +441,20 @@ class ShimmedPath(object):
|
||||
)
|
||||
if not methods and not classmethods:
|
||||
return provided
|
||||
new_functions = provided.__dict__.copy()
|
||||
if classmethods:
|
||||
new_functions.update(
|
||||
{
|
||||
method_name: clsmethod
|
||||
for method_name, clsmethod in classmethods.items()
|
||||
if method_name not in provided.__dict__
|
||||
}
|
||||
)
|
||||
if methods:
|
||||
new_functions.update(
|
||||
{
|
||||
method_name: method
|
||||
for method_name, method in methods.items()
|
||||
if method_name not in provided.__dict__
|
||||
}
|
||||
)
|
||||
classname = provided.__name__
|
||||
if six.PY2:
|
||||
classname = classname.encode(sys.getdefaultencoding())
|
||||
type_ = type(classname, (provided,), new_functions)
|
||||
type_ = type(classname, (provided,), {})
|
||||
|
||||
if classmethods:
|
||||
for method_name, clsmethod in classmethods.items():
|
||||
if method_name not in provided.__dict__:
|
||||
type.__setattr__(type_, method_name, clsmethod)
|
||||
|
||||
if methods:
|
||||
for method_name, clsmethod in methods.items():
|
||||
if method_name not in provided.__dict__:
|
||||
type.__setattr__(type_, method_name, clsmethod)
|
||||
return type_
|
||||
|
||||
@property
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ from .models.lockfile import Lockfile
|
||||
from .models.pipfile import Pipfile
|
||||
from .models.requirements import Requirement
|
||||
|
||||
__version__ = "1.5.12"
|
||||
__version__ = "1.5.13"
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
+44
-30
@@ -1580,29 +1580,7 @@ class SetupInfo(object):
|
||||
|
||||
def build_wheel(self):
|
||||
# type: () -> S
|
||||
if not self.pyproject.exists():
|
||||
build_requires = ", ".join(['"{0}"'.format(r) for r in self.build_requires])
|
||||
self.pyproject.write_text(
|
||||
six.text_type(
|
||||
"""
|
||||
[build-system]
|
||||
requires = [{0}]
|
||||
build-backend = "{1}"
|
||||
""".format(
|
||||
build_requires, self.build_backend
|
||||
).strip()
|
||||
)
|
||||
)
|
||||
return build_pep517(
|
||||
self.base_dir,
|
||||
self.extra_kwargs["build_dir"],
|
||||
config_settings=self.pep517_config,
|
||||
dist_type="wheel",
|
||||
)
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
def build_sdist(self):
|
||||
# type: () -> S
|
||||
need_delete = False
|
||||
if not self.pyproject.exists():
|
||||
if not self.build_requires:
|
||||
build_requires = '"setuptools", "wheel"'
|
||||
@@ -1621,12 +1599,49 @@ build-backend = "{1}"
|
||||
).strip()
|
||||
)
|
||||
)
|
||||
return build_pep517(
|
||||
need_delete = True
|
||||
result = build_pep517(
|
||||
self.base_dir,
|
||||
self.extra_kwargs["build_dir"],
|
||||
config_settings=self.pep517_config,
|
||||
dist_type="wheel",
|
||||
)
|
||||
if need_delete:
|
||||
self.pyproject.unlink()
|
||||
return result
|
||||
|
||||
# noinspection PyPackageRequirements
|
||||
def build_sdist(self):
|
||||
# type: () -> S
|
||||
need_delete = False
|
||||
if not self.pyproject.exists():
|
||||
if not self.build_requires:
|
||||
build_requires = '"setuptools", "wheel"'
|
||||
else:
|
||||
build_requires = ", ".join(
|
||||
['"{0}"'.format(r) for r in self.build_requires]
|
||||
)
|
||||
self.pyproject.write_text(
|
||||
six.text_type(
|
||||
"""
|
||||
[build-system]
|
||||
requires = [{0}]
|
||||
build-backend = "{1}"
|
||||
""".format(
|
||||
build_requires, self.build_backend
|
||||
).strip()
|
||||
)
|
||||
)
|
||||
need_delete = True
|
||||
result = build_pep517(
|
||||
self.base_dir,
|
||||
self.extra_kwargs["build_dir"],
|
||||
config_settings=self.pep517_config,
|
||||
dist_type="sdist",
|
||||
)
|
||||
if need_delete:
|
||||
self.pyproject.unlink()
|
||||
return result
|
||||
|
||||
def build(self):
|
||||
# type: () -> "SetupInfo"
|
||||
@@ -1874,10 +1889,7 @@ build-backend = "{1}"
|
||||
ireq.link, "is_vcs", getattr(ireq.link, "is_artifact", False)
|
||||
)
|
||||
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, symlinks=True)
|
||||
ireq.source_dir = target
|
||||
|
||||
if not (ireq.editable and is_file and is_vcs):
|
||||
if ireq.is_wheel:
|
||||
only_download = True
|
||||
@@ -1895,10 +1907,12 @@ build-backend = "{1}"
|
||||
if build_location_func is None:
|
||||
build_location_func = getattr(ireq, "ensure_build_location", None)
|
||||
if not ireq.source_dir:
|
||||
build_kwargs = {"build_dir": kwargs["build_dir"], "autodelete": False}
|
||||
build_kwargs = {
|
||||
"build_dir": kwargs["build_dir"],
|
||||
"autodelete": False, "parallel_builds": True
|
||||
}
|
||||
call_function_with_correct_args(build_location_func, **build_kwargs)
|
||||
ireq.ensure_has_source_dir(kwargs["src_dir"])
|
||||
src_dir = ireq.source_dir
|
||||
pip_shims.shims.shim_unpack(
|
||||
download_dir=download_dir,
|
||||
ireq=ireq,
|
||||
|
||||
+9
-3
@@ -112,12 +112,18 @@ class VCSRepository(object):
|
||||
@classmethod
|
||||
def monkeypatch_pip(cls):
|
||||
# type: () -> Tuple[Any, ...]
|
||||
from pip_shims.compat import get_allowed_args
|
||||
|
||||
target_module = pip_shims.shims.VcsSupport.__module__
|
||||
pip_vcs = importlib.import_module(target_module)
|
||||
args, kwargs = get_allowed_args(pip_vcs.VersionControl.run_command)
|
||||
run_command_defaults = pip_vcs.VersionControl.run_command.__defaults__
|
||||
# set the default to not write stdout, the first option sets this value
|
||||
new_defaults = [False] + list(run_command_defaults)[1:]
|
||||
new_defaults = tuple(new_defaults)
|
||||
if "show_stdout" not in args and "show_stdout" not in kwargs:
|
||||
new_defaults = run_command_defaults
|
||||
else:
|
||||
# set the default to not write stdout, the first option sets this value
|
||||
new_defaults = [False] + list(run_command_defaults)[1:]
|
||||
new_defaults = tuple(new_defaults)
|
||||
if six.PY3:
|
||||
try:
|
||||
pip_vcs.VersionControl.run_command.__defaults__ = new_defaults
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ def strip_ssh_from_git_uri(uri):
|
||||
|
||||
def add_ssh_scheme_to_git_uri(uri):
|
||||
# type: (S) -> S
|
||||
"""Cleans VCS uris from pip format"""
|
||||
"""Cleans VCS uris from pipenv.patched.notpip format"""
|
||||
if isinstance(uri, six.string_types):
|
||||
# Add scheme for parsing purposes, this is also what pip does
|
||||
if uri.startswith("git+") and "://" not in uri:
|
||||
|
||||
Vendored
+2
-2
@@ -26,7 +26,7 @@ requests==2.23.0
|
||||
idna==2.9
|
||||
urllib3==1.25.9
|
||||
certifi==2020.4.5.1
|
||||
requirementslib==1.5.12
|
||||
requirementslib==1.5.13
|
||||
attrs==19.3.0
|
||||
distlib==0.3.0
|
||||
packaging==20.3
|
||||
@@ -39,7 +39,7 @@ semver==2.9.0
|
||||
toml==0.10.1
|
||||
cached-property==1.5.1
|
||||
vistir==0.5.2
|
||||
pip-shims==0.5.2
|
||||
pip-shims==0.5.3
|
||||
contextlib2==0.6.0.post1
|
||||
funcsigs==1.0.2
|
||||
enum34==1.1.10
|
||||
|
||||
@@ -2,7 +2,7 @@ diff --git a/pipenv/vendor/pip_shims/__init__.py b/pipenv/vendor/pip_shims/__ini
|
||||
index 2af4166e..598b9ad8 100644
|
||||
--- a/pipenv/vendor/pip_shims/__init__.py
|
||||
+++ b/pipenv/vendor/pip_shims/__init__.py
|
||||
@@ -11,10 +11,13 @@ __version__ = "0.5.1"
|
||||
@@ -11,10 +11,13 @@ __version__ = "0.5.3"
|
||||
if "pip_shims" in sys.modules:
|
||||
# mainly to keep a reference to the old module on hand so it doesn't get
|
||||
# weakref'd away
|
||||
|
||||
@@ -239,7 +239,7 @@ def test_get_vcs_refs(PipenvInstance_NoPyPI):
|
||||
@pytest.mark.urls
|
||||
@pytest.mark.install
|
||||
@pytest.mark.needs_internet
|
||||
@pytest.mark.skip_py27_win
|
||||
@pytest.mark.py3_only
|
||||
@pytest.mark.skip_py38
|
||||
def test_vcs_entry_supersedes_non_vcs(PipenvInstance):
|
||||
"""See issue #2181 -- non-editable VCS dep was specified, but not showing up
|
||||
|
||||
Reference in New Issue
Block a user