mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Revise how we do the import patch to include only module pipenv.
This commit is contained in:
@@ -1529,7 +1529,6 @@ def pip_install(
|
||||
project_python(project, system=allow_global),
|
||||
_get_runnable_pip(),
|
||||
"install",
|
||||
"--ignore-installed",
|
||||
]
|
||||
pip_args = get_pip_args(
|
||||
project,
|
||||
|
||||
@@ -26,7 +26,13 @@ if __name__ == "__main__":
|
||||
warnings.filterwarnings(
|
||||
"ignore", category=DeprecationWarning, module=".*packaging\\.version"
|
||||
)
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
|
||||
import importlib.util
|
||||
import sys
|
||||
spec = importlib.util.spec_from_file_location(
|
||||
"pipenv", location=os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "__init__.py"))
|
||||
pipenv = importlib.util.module_from_spec(spec)
|
||||
sys.modules["pipenv"] = pipenv
|
||||
spec.loader.exec_module(pipenv)
|
||||
from pipenv.patched.pip._internal.cli.main import main as _main
|
||||
|
||||
sys.exit(_main())
|
||||
|
||||
Reference in New Issue
Block a user