Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove --sequential #5348

Merged
merged 4 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------------------
Expand Down
3 changes: 0 additions & 3 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
Expand Down
20 changes: 0 additions & 20 deletions pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def __init__(self):
self.keep_outdated = False
self.skip_lock = False
self.ignore_pipfile = False
self.sequential = False
self.code = False
self.requirementstxt = None
self.deploy = False
Expand Down Expand Up @@ -133,24 +132,6 @@ def callback(ctx, param, value):
)(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)
Expand Down Expand Up @@ -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


Expand Down
15 changes: 1 addition & 14 deletions pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -1190,7 +1186,6 @@ def do_init(
ignore_pipfile=False,
skip_lock=False,
system=False,
concurrent=True,
deploy=False,
pre=False,
keep_outdated=False,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -2030,7 +2024,6 @@ def do_install(
ignore_pipfile=False,
skip_lock=False,
requirementstxt=False,
sequential=False,
pre=False,
deploy=False,
keep_outdated=False,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -3032,7 +3021,6 @@ def do_sync(
user=False,
clear=False,
unused=False,
sequential=False,
pypi_mirror=None,
system=False,
deploy=False,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions pipenv/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,6 @@ def __init__(self) -> None:
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.

Expand Down
52 changes: 0 additions & 52 deletions tests/integration/test_install_twists.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,58 +103,6 @@ def test_https_dependency_links_install(self, pipenv_instance_pypi):
)


@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):
Expand Down
24 changes: 0 additions & 24 deletions tests/integration/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,6 @@ def test_sync_should_not_lock(pipenv_instance_pypi):
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):
"""
Expand Down