mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-19 14:59:41 +08:00
Fix virtual environment tests
This commit is contained in:
+6
-2
@@ -14,6 +14,12 @@ env:
|
|||||||
- JEDI_TEST_ENVIRONMENT=35
|
- JEDI_TEST_ENVIRONMENT=35
|
||||||
- JEDI_TEST_ENVIRONMENT=36
|
- JEDI_TEST_ENVIRONMENT=36
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
# Required to properly create a virtual environment with system Python 3.4.
|
||||||
|
- python3.4-venv
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- python: pypy
|
- python: pypy
|
||||||
@@ -39,8 +45,6 @@ before_install:
|
|||||||
# something twice, but it doesn't really matter, because they are appended.
|
# something twice, but it doesn't really matter, because they are appended.
|
||||||
- export PATH=$PATH:/opt/python/3.3/bin
|
- export PATH=$PATH:/opt/python/3.3/bin
|
||||||
- export PATH=$PATH:/opt/python/3.5/bin
|
- export PATH=$PATH:/opt/python/3.5/bin
|
||||||
# 3.6 was not installed manually, but already is on the system. However
|
|
||||||
# it's not on path (unless 3.6 is selected).
|
|
||||||
- export PATH=$PATH:/opt/python/3.6/bin
|
- export PATH=$PATH:/opt/python/3.6/bin
|
||||||
install:
|
install:
|
||||||
- pip install --quiet tox-travis
|
- pip install --quiet tox-travis
|
||||||
|
|||||||
@@ -239,14 +239,11 @@ def _get_executable_path(path, safe=True):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
bin_name = 'Scripts'
|
activate = os.path.join(path, 'Scripts', 'activate.bat')
|
||||||
extension = '.exe'
|
python = os.path.join(path, 'Scripts', 'python.exe')
|
||||||
else:
|
else:
|
||||||
bin_name = 'bin'
|
activate = os.path.join(path, 'bin', 'activate')
|
||||||
extension = ''
|
python = os.path.join(path, 'bin', 'python')
|
||||||
bin_folder = os.path.join(path, bin_name)
|
|
||||||
activate = os.path.join(bin_folder, 'activate')
|
|
||||||
python = os.path.join(bin_folder, 'python' + extension)
|
|
||||||
if not all(os.path.exists(p) for p in (activate, python)):
|
if not all(os.path.exists(p) for p in (activate, python)):
|
||||||
raise InvalidPythonEnvironment("One of bin/activate and bin/python is missing.")
|
raise InvalidPythonEnvironment("One of bin/activate and bin/python is missing.")
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,14 @@ if [[ $JEDI_TEST_ENVIRONMENT == "35" ]]; then
|
|||||||
VERSION=3.5
|
VERSION=3.5
|
||||||
DOWNLOAD=1
|
DOWNLOAD=1
|
||||||
fi
|
fi
|
||||||
|
# 3.6 is already installed on Travis but not as root. This is problematic for
|
||||||
|
# our virtualenv tests because we require the Python used to create a virtual
|
||||||
|
# environment to be owned by root (or to be in a safe location which is not the
|
||||||
|
# case here).
|
||||||
|
if [[ $JEDI_TEST_ENVIRONMENT == "36" ]]; then
|
||||||
|
VERSION=3.6
|
||||||
|
DOWNLOAD=1
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $VERSION ]]; then
|
if [[ -z $VERSION ]]; then
|
||||||
echo "Environments should already be installed"
|
echo "Environments should already be installed"
|
||||||
|
|||||||
Reference in New Issue
Block a user