1
0
forked from VimPlug/jedi

Add a way to specify environments in tox

This commit is contained in:
Dave Halter
2017-12-19 19:02:57 +01:00
parent 6780eba157
commit a9ebd92c20
6 changed files with 57 additions and 25 deletions

View File

@@ -94,13 +94,18 @@ def find_python_environments():
if version_string == current_version:
yield get_default_environment()
else:
exe = find_executable('python' + version_string)
if exe is not None:
path = os.path.dirname(os.path.dirname(exe))
try:
yield Environment(path, exe)
except InvalidPythonEnvironment:
pass
try:
yield get_python_environment('python' + version_string)
except InvalidPythonEnvironment:
pass
def get_python_environment(python_name):
exe = find_executable(python_name)
if exe is None:
raise InvalidPythonEnvironment("This executable doesn't exist.")
path = os.path.dirname(os.path.dirname(exe))
return Environment(path, exe)
def create_environment(path):