diff --git a/news/5719.bugfix.rst b/news/5719.bugfix.rst new file mode 100644 index 00000000..2d29c8fd --- /dev/null +++ b/news/5719.bugfix.rst @@ -0,0 +1 @@ +Remove the ``sys.path`` modifications and as a result fixes keyring support. diff --git a/pipenv/__init__.py b/pipenv/__init__.py index 0c5943f7..df386842 100644 --- a/pipenv/__init__.py +++ b/pipenv/__init__.py @@ -1,27 +1,15 @@ -# |~~\' |~~ -# |__/||~~\|--|/~\\ / -# | ||__/|__| |\/ -# | - import os -import sys import warnings -from pipenv.__version__ import __version__ # noqa +from pipenv.cli import cli from pipenv.patched.pip._vendor.urllib3.exceptions import DependencyWarning warnings.filterwarnings("ignore", category=DependencyWarning) warnings.filterwarnings("ignore", category=ResourceWarning) warnings.filterwarnings("ignore", category=UserWarning) -PIPENV_ROOT = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) -PIPENV_VENDOR = os.sep.join([PIPENV_ROOT, "vendor"]) -PIP_VENDOR = os.sep.join([PIPENV_ROOT, "patched", "pip", "_vendor"]) # Load patched pip instead of system pip os.environ["PIP_DISABLE_PIP_VERSION_CHECK"] = "1" -sys.path.insert(0, PIPENV_ROOT) -sys.path.insert(0, PIPENV_VENDOR) -sys.path.insert(0, PIP_VENDOR) if os.name == "nt": from pipenv.vendor import colorama @@ -30,8 +18,6 @@ if os.name == "nt": if not os.getenv("NO_COLOR") or no_color: colorama.just_fix_windows_console() -from . import resolver # noqa: F401,E402 -from .cli import cli # noqa: E402 if __name__ == "__main__": cli() diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 04e72ca0..49ae42b4 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -668,6 +668,7 @@ def run_open(state, module, *args, **kwargs): @system_option @option("--bare", is_flag=True, default=False, help="Minimal output.") @sync_options +@site_packages_option @pass_state @pass_context def sync(ctx, state, bare=False, user=False, unused=False, **kwargs): @@ -687,6 +688,7 @@ def sync(ctx, state, bare=False, user=False, unused=False, **kwargs): system=state.system, extra_pip_args=state.installstate.extra_pip_args, categories=state.installstate.categories, + site_packages=state.site_packages, ) if retcode: ctx.abort() diff --git a/pipenv/routines/install.py b/pipenv/routines/install.py index 3ef79c25..18a6e1c5 100644 --- a/pipenv/routines/install.py +++ b/pipenv/routines/install.py @@ -354,6 +354,7 @@ def do_sync( deploy=False, extra_pip_args=None, categories=None, + site_packages=False, ): # The lock file needs to exist because sync won't write to it. if not project.lockfile_exists: @@ -368,6 +369,7 @@ def do_sync( deploy=deploy, pypi_mirror=pypi_mirror, clear=clear, + site_packages=site_packages, ) # Install everything.