mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #5348 from pypa/remove-sequential
Remove --sequential
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ This document covers some of Pipenv's more glorious and advanced features.
|
||||
|
||||
- Dependencies of wheels provided in a ``Pipfile`` will not be captured by ``$ pipenv lock``.
|
||||
- There are some known issues with using private indexes, related to hashing. We're actively working to solve this problem. You may have great luck with this, however.
|
||||
- Installation is intended to be as deterministic as possible — use the ``--sequential`` flag to increase this, if experiencing issues.
|
||||
- Installation is intended to be as deterministic as possible.
|
||||
|
||||
☤ Specifying Package Indexes
|
||||
----------------------------
|
||||
|
||||
@@ -244,7 +244,6 @@ def install(state, **kwargs):
|
||||
ignore_pipfile=state.installstate.ignore_pipfile,
|
||||
skip_lock=state.installstate.skip_lock,
|
||||
requirementstxt=state.installstate.requirementstxt,
|
||||
sequential=state.installstate.sequential,
|
||||
pre=state.installstate.pre,
|
||||
deploy=state.installstate.deploy,
|
||||
keep_outdated=state.installstate.keep_outdated,
|
||||
@@ -562,7 +561,6 @@ def update(ctx, state, bare=False, dry_run=None, outdated=False, **kwargs):
|
||||
user=False,
|
||||
clear=state.clear,
|
||||
unused=False,
|
||||
sequential=state.installstate.sequential,
|
||||
pypi_mirror=state.pypi_mirror,
|
||||
extra_pip_args=state.installstate.extra_pip_args,
|
||||
)
|
||||
@@ -653,7 +651,6 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs):
|
||||
user=user,
|
||||
clear=state.clear,
|
||||
unused=unused,
|
||||
sequential=state.installstate.sequential,
|
||||
pypi_mirror=state.pypi_mirror,
|
||||
system=state.system,
|
||||
extra_pip_args=state.installstate.extra_pip_args,
|
||||
|
||||
@@ -82,7 +82,6 @@ class InstallState:
|
||||
self.keep_outdated = False
|
||||
self.skip_lock = False
|
||||
self.ignore_pipfile = False
|
||||
self.sequential = False
|
||||
self.code = False
|
||||
self.requirementstxt = None
|
||||
self.deploy = False
|
||||
@@ -133,24 +132,6 @@ def editable_option(f):
|
||||
)(f)
|
||||
|
||||
|
||||
def sequential_option(f):
|
||||
def callback(ctx, param, value):
|
||||
state = ctx.ensure_object(State)
|
||||
state.installstate.sequential = value
|
||||
return value
|
||||
|
||||
return option(
|
||||
"--sequential",
|
||||
is_flag=True,
|
||||
default=False,
|
||||
expose_value=False,
|
||||
help="Install dependencies one-at-a-time, instead of concurrently.",
|
||||
callback=callback,
|
||||
type=click_types.BOOL,
|
||||
show_envvar=True,
|
||||
)(f)
|
||||
|
||||
|
||||
def skip_lock_option(f):
|
||||
def callback(ctx, param, value):
|
||||
state = ctx.ensure_object(State)
|
||||
@@ -583,7 +564,6 @@ def lock_options(f):
|
||||
def sync_options(f):
|
||||
f = install_base_options(f)
|
||||
f = install_dev_option(f)
|
||||
f = sequential_option(f)
|
||||
return f
|
||||
|
||||
|
||||
|
||||
+1
-14
@@ -755,7 +755,6 @@ def do_install_dependencies(
|
||||
allow_global=False,
|
||||
ignore_hashes=False,
|
||||
skip_lock=False,
|
||||
concurrent=True,
|
||||
requirements_dir=None,
|
||||
pypi_mirror=None,
|
||||
extra_pip_args=None,
|
||||
@@ -792,10 +791,7 @@ def do_install_dependencies(
|
||||
)
|
||||
dev = dev or dev_only
|
||||
deps_list = list(lockfile.get_requirements(dev=dev, only=dev_only))
|
||||
if concurrent:
|
||||
nprocs = project.s.PIPENV_MAX_SUBPROCESS
|
||||
else:
|
||||
nprocs = 1
|
||||
nprocs = 2
|
||||
procs = queue.Queue(maxsize=nprocs)
|
||||
failed_deps_queue = queue.Queue()
|
||||
if skip_lock:
|
||||
@@ -1190,7 +1186,6 @@ def do_init(
|
||||
ignore_pipfile=False,
|
||||
skip_lock=False,
|
||||
system=False,
|
||||
concurrent=True,
|
||||
deploy=False,
|
||||
pre=False,
|
||||
keep_outdated=False,
|
||||
@@ -1293,7 +1288,6 @@ def do_init(
|
||||
dev_only=dev_only,
|
||||
allow_global=allow_global,
|
||||
skip_lock=skip_lock,
|
||||
concurrent=concurrent,
|
||||
requirements_dir=requirements_dir,
|
||||
pypi_mirror=pypi_mirror,
|
||||
extra_pip_args=extra_pip_args,
|
||||
@@ -2030,7 +2024,6 @@ def do_install(
|
||||
ignore_pipfile=False,
|
||||
skip_lock=False,
|
||||
requirementstxt=False,
|
||||
sequential=False,
|
||||
pre=False,
|
||||
deploy=False,
|
||||
keep_outdated=False,
|
||||
@@ -2051,7 +2044,6 @@ def do_install(
|
||||
# Don't search for requirements.txt files if the user provides one
|
||||
if requirementstxt or package_args or project.pipfile_exists:
|
||||
skip_requirements = True
|
||||
concurrent = not sequential
|
||||
# Ensure that virtualenv is available and pipfile are available
|
||||
ensure_project(
|
||||
project,
|
||||
@@ -2186,7 +2178,6 @@ def do_install(
|
||||
ignore_pipfile=ignore_pipfile,
|
||||
system=system,
|
||||
skip_lock=skip_lock,
|
||||
concurrent=concurrent,
|
||||
deploy=deploy,
|
||||
pre=pre,
|
||||
requirements_dir=requirements_directory,
|
||||
@@ -2207,7 +2198,6 @@ def do_install(
|
||||
dev=dev,
|
||||
system=system,
|
||||
allow_global=system,
|
||||
concurrent=concurrent,
|
||||
keep_outdated=keep_outdated,
|
||||
requirements_dir=requirements_directory,
|
||||
deploy=deploy,
|
||||
@@ -2357,7 +2347,6 @@ def do_install(
|
||||
dev=dev,
|
||||
system=system,
|
||||
allow_global=system,
|
||||
concurrent=concurrent,
|
||||
keep_outdated=keep_outdated,
|
||||
requirements_dir=requirements_directory,
|
||||
deploy=deploy,
|
||||
@@ -3032,7 +3021,6 @@ def do_sync(
|
||||
user=False,
|
||||
clear=False,
|
||||
unused=False,
|
||||
sequential=False,
|
||||
pypi_mirror=None,
|
||||
system=False,
|
||||
deploy=False,
|
||||
@@ -3065,7 +3053,6 @@ def do_sync(
|
||||
project,
|
||||
dev=dev,
|
||||
allow_global=system,
|
||||
concurrent=(not sequential),
|
||||
requirements_dir=requirements_dir,
|
||||
ignore_pipfile=True, # Don't check if Pipfile and lock match.
|
||||
pypi_mirror=pypi_mirror,
|
||||
|
||||
@@ -196,12 +196,6 @@ class Setting:
|
||||
Default is 0. Automatically set to 1 on CI environments for robust testing.
|
||||
"""
|
||||
|
||||
self.PIPENV_MAX_SUBPROCESS = int(os.environ.get("PIPENV_MAX_SUBPROCESS", "8"))
|
||||
"""How many subprocesses should Pipenv use when installing.
|
||||
|
||||
Default is 16, an arbitrary number that seems to work.
|
||||
"""
|
||||
|
||||
self.PIPENV_NO_INHERIT = "PIPENV_NO_INHERIT" in os.environ
|
||||
"""Tell Pipenv not to inherit parent directories.
|
||||
|
||||
|
||||
@@ -103,58 +103,6 @@ setup(
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@pytest.mark.multiprocessing
|
||||
def test_multiprocess_bug_and_install(pipenv_instance_pypi):
|
||||
with temp_environ():
|
||||
os.environ["PIPENV_MAX_SUBPROCESS"] = "2"
|
||||
|
||||
with pipenv_instance_pypi(chdir=True) as p:
|
||||
with open(p.pipfile_path, "w") as f:
|
||||
contents = """
|
||||
[packages]
|
||||
pytz = "*"
|
||||
six = "*"
|
||||
dataclasses-json = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install")
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "dataclasses-json" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import six; import pytz; import dataclasses_json;"')
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.install
|
||||
@pytest.mark.sequential
|
||||
def test_sequential_mode(pipenv_instance_pypi):
|
||||
|
||||
with pipenv_instance_pypi(chdir=True) as p:
|
||||
with open(p.pipfile_path, "w") as f:
|
||||
contents = """
|
||||
[packages]
|
||||
six = "*"
|
||||
urllib3 = "*"
|
||||
pytz = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv("install --sequential")
|
||||
assert c.returncode == 0
|
||||
|
||||
assert "six" in p.lockfile["default"]
|
||||
assert "pytz" in p.lockfile["default"]
|
||||
assert "urllib3" in p.lockfile["default"]
|
||||
|
||||
c = p.pipenv('run python -c "import six; import urllib3; import pytz;"')
|
||||
assert c.returncode == 0
|
||||
|
||||
|
||||
@pytest.mark.run
|
||||
@pytest.mark.install
|
||||
def test_normalize_name_install(pipenv_instance_private_pypi):
|
||||
|
||||
@@ -70,30 +70,6 @@ six = "*"
|
||||
assert lockfile_content == p.lockfile
|
||||
|
||||
|
||||
@pytest.mark.sync
|
||||
@pytest.mark.lock
|
||||
def test_sync_sequential_detect_errors(pipenv_instance_private_pypi):
|
||||
with pipenv_instance_private_pypi() as p:
|
||||
with open(p.pipfile_path, 'w') as f:
|
||||
contents = """
|
||||
[packages]
|
||||
requests = "*"
|
||||
""".strip()
|
||||
f.write(contents)
|
||||
|
||||
c = p.pipenv('lock')
|
||||
assert c.returncode == 0
|
||||
|
||||
# Force hash mismatch when installing `requests`
|
||||
lock = p.lockfile
|
||||
lock['default']['requests']['hashes'] = ['sha256:' + '0' * 64]
|
||||
with open(p.lockfile_path, 'w') as f:
|
||||
json.dump(lock, f)
|
||||
|
||||
c = p.pipenv('sync --sequential')
|
||||
assert c.returncode != 0
|
||||
|
||||
|
||||
@pytest.mark.sync
|
||||
def test_sync_consider_pip_target(pipenv_instance_pypi):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user