From 510a633c2736982205d4e92195c681582cecde85 Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Fri, 9 Sep 2022 22:01:49 +0200 Subject: [PATCH 1/4] Remove PIPENV_MAX_SUBPROCESS This is now meaningless since we use pip batch install. --- pipenv/environments.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pipenv/environments.py b/pipenv/environments.py index 7e08876203..73eac01a6f 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -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. From abe6f565a2a77f178e4ab0859a3988b0755b15c3 Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Fri, 9 Sep 2022 22:43:37 +0200 Subject: [PATCH 2/4] Remove the --sequential from docs We now use the batch install method from pip directly, so it's meaningless. --- docs/advanced.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced.rst b/docs/advanced.rst index 0f4e301058..91601a25c2 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -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 ---------------------------- From a38d1538c5fc4a45c95c67452730eec887f0fea5 Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Fri, 9 Sep 2022 22:50:22 +0200 Subject: [PATCH 3/4] Remove sequential\concurrent keyword Since we removed sequential options ... --- pipenv/cli/command.py | 3 --- pipenv/cli/options.py | 20 -------------------- pipenv/core.py | 15 +-------------- 3 files changed, 1 insertion(+), 37 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 0a8abd24ef..1559c39025 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -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, diff --git a/pipenv/cli/options.py b/pipenv/cli/options.py index ec16a16b81..6b1d0eb09d 100644 --- a/pipenv/cli/options.py +++ b/pipenv/cli/options.py @@ -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 @@ -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) @@ -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 diff --git a/pipenv/core.py b/pipenv/core.py index 5294512cd8..6d262eb6b0 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -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, From 3eacea2f494c73a669f8726eaf49abd1f98e6e54 Mon Sep 17 00:00:00 2001 From: Oz N Tiram Date: Fri, 9 Sep 2022 22:56:55 +0200 Subject: [PATCH 4/4] Remove tests with --sequential --- tests/integration/test_install_twists.py | 52 ------------------------ tests/integration/test_sync.py | 24 ----------- 2 files changed, 76 deletions(-) diff --git a/tests/integration/test_install_twists.py b/tests/integration/test_install_twists.py index 95df7bbc09..71aab05ba7 100644 --- a/tests/integration/test_install_twists.py +++ b/tests/integration/test_install_twists.py @@ -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): diff --git a/tests/integration/test_sync.py b/tests/integration/test_sync.py index 73fb41bf00..9dc6855818 100644 --- a/tests/integration/test_sync.py +++ b/tests/integration/test_sync.py @@ -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): """