Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

Commit 316ced8

Browse files
committed
HACK: force pipenv to create venvs (right now for tests)
1 parent e5807b2 commit 316ced8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

langserver/clone_workspace.py

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from functools import lru_cache
77
from enum import Enum
88
from pathlib import Path
9+
import os
910

1011
log = logging.getLogger(__name__)
1112

@@ -183,6 +184,14 @@ def run_command(self, command, no_prefix=False, **kwargs):
183184
'''
184185
kwargs["cwd"] = self.CLONED_PROJECT_PATH
185186

187+
# HACK: this is to get our spawned pipenv to keep creating
188+
# venvs even if the language server itself is running inside one
189+
# See:
190+
# https://github.com/pypa/pipenv/blob/4e8deda9cbf2a658ab40ca31cc6e249c0b53d6f4/pipenv/environments.py#L58
191+
env = kwargs.get("env", os.environ.copy())
192+
env["VIRTUAL_ENV"] = ""
193+
kwargs["env"] = env
194+
186195
# add pipenv prefix
187196
if not no_prefix:
188197
if type(command) is str:

0 commit comments

Comments
 (0)