Auto merge of #3344 - bstaletic:no-py34, r=micbou
[READY] Drop python 3.4 see Valloric/ycmd#1207 for details. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/3344) <!-- Reviewable:end -->
This commit is contained in:
commit
72ed996089
@ -54,7 +54,7 @@ jobs:
|
|||||||
- *run-tests
|
- *run-tests
|
||||||
- *upload-coverage
|
- *upload-coverage
|
||||||
environment:
|
environment:
|
||||||
YCMD_PYTHON_VERSION: 3.4
|
YCMD_PYTHON_VERSION: 3.5
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build:
|
build:
|
||||||
|
@ -50,7 +50,7 @@ if [ "${YCMD_PYTHON_VERSION}" == "2.7" ]; then
|
|||||||
# -lSystemStubs"
|
# -lSystemStubs"
|
||||||
PYENV_VERSION="2.7.2"
|
PYENV_VERSION="2.7.2"
|
||||||
else
|
else
|
||||||
PYENV_VERSION="3.4.0"
|
PYENV_VERSION="3.5.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In order to work with ycmd, python *must* be built as a shared library. The
|
# In order to work with ycmd, python *must* be built as a shared library. The
|
||||||
|
@ -15,7 +15,7 @@ env:
|
|||||||
- COVERAGE=true
|
- COVERAGE=true
|
||||||
matrix:
|
matrix:
|
||||||
- YCM_PYTHON_VERSION=2.7
|
- YCM_PYTHON_VERSION=2.7
|
||||||
- YCM_PYTHON_VERSION=3.4
|
- YCM_PYTHON_VERSION=3.5
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
|
@ -45,7 +45,7 @@ if [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
|
|||||||
# "TypeError: argument can't be <type 'unicode'>"
|
# "TypeError: argument can't be <type 'unicode'>"
|
||||||
PYENV_VERSION="2.7.1"
|
PYENV_VERSION="2.7.1"
|
||||||
else
|
else
|
||||||
PYENV_VERSION="3.4.0"
|
PYENV_VERSION="3.5.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# In order to work with ycmd, python *must* be built as a shared library. This
|
# In order to work with ycmd, python *must* be built as a shared library. This
|
||||||
|
@ -11,11 +11,9 @@ import sys
|
|||||||
import os.path as p
|
import os.path as p
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
PY_MAJOR, PY_MINOR, PY_PATCH = sys.version_info[ 0 : 3 ]
|
version = sys.version_info[ 0 : 3 ]
|
||||||
if not ( ( PY_MAJOR == 2 and PY_MINOR == 7 and PY_PATCH >= 1 ) or
|
if version < ( 2, 7, 1 ) or ( 3, 0, 0 ) <= version < ( 3, 5, 1 ):
|
||||||
( PY_MAJOR == 3 and PY_MINOR >= 4 ) or
|
sys.exit( 'YouCompleteMe requires Python >= 2.7.1 or >= 3.5.1; '
|
||||||
PY_MAJOR > 3 ):
|
|
||||||
sys.exit( 'YouCompleteMe requires Python >= 2.7.1 or >= 3.4; '
|
|
||||||
'your version of Python is ' + sys.version )
|
'your version of Python is ' + sys.version )
|
||||||
|
|
||||||
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
|
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
|
||||||
|
@ -58,7 +58,7 @@ elseif ( v:version > 800 || ( v:version == 800 && has( 'patch1436' ) ) ) &&
|
|||||||
\ !has( 'python_compiled' ) && !has( 'python3_compiled' )
|
\ !has( 'python_compiled' ) && !has( 'python3_compiled' )
|
||||||
echohl WarningMsg |
|
echohl WarningMsg |
|
||||||
\ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
|
\ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
|
||||||
\ "Python (2.7.1+ or 3.4+) support." |
|
\ "Python (2.7.1+ or 3.5.1+) support." |
|
||||||
\ echohl None
|
\ echohl None
|
||||||
call s:restore_cpo()
|
call s:restore_cpo()
|
||||||
finish
|
finish
|
||||||
|
@ -33,7 +33,7 @@ DIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',
|
|||||||
'ycmd' )
|
'ycmd' )
|
||||||
WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
|
WIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )
|
||||||
PYTHON_BINARY_REGEX = re.compile(
|
PYTHON_BINARY_REGEX = re.compile(
|
||||||
r'python((2(\.[67])?)|(3(\.[3-9])?))?(.exe)?$', re.IGNORECASE )
|
r'python((2(\.7)?)|(3(\.[5-9])?))?(.exe)?$', re.IGNORECASE )
|
||||||
|
|
||||||
|
|
||||||
# Not caching the result of this function; users shouldn't have to restart Vim
|
# Not caching the result of this function; users shouldn't have to restart Vim
|
||||||
@ -51,7 +51,7 @@ def PathToPythonInterpreter():
|
|||||||
return python_interpreter
|
return python_interpreter
|
||||||
|
|
||||||
raise RuntimeError( "Path in 'g:ycm_server_python_interpreter' option "
|
raise RuntimeError( "Path in 'g:ycm_server_python_interpreter' option "
|
||||||
"does not point to a valid Python 2.7 or 3.4+." )
|
"does not point to a valid Python 2.7 or 3.5+." )
|
||||||
|
|
||||||
python_interpreter = _PathToPythonUsedDuringBuild()
|
python_interpreter = _PathToPythonUsedDuringBuild()
|
||||||
if python_interpreter and utils.GetExecutable( python_interpreter ):
|
if python_interpreter and utils.GetExecutable( python_interpreter ):
|
||||||
@ -77,7 +77,7 @@ def PathToPythonInterpreter():
|
|||||||
if python_interpreter:
|
if python_interpreter:
|
||||||
return python_interpreter
|
return python_interpreter
|
||||||
|
|
||||||
raise RuntimeError( "Cannot find Python 2.7 or 3.4+. "
|
raise RuntimeError( "Cannot find Python 2.7 or 3.5+. "
|
||||||
"Set the 'g:ycm_server_python_interpreter' option "
|
"Set the 'g:ycm_server_python_interpreter' option "
|
||||||
"to a Python interpreter path." )
|
"to a Python interpreter path." )
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ def _PathToPythonUsedDuringBuild():
|
|||||||
|
|
||||||
|
|
||||||
def _EndsWithPython( path ):
|
def _EndsWithPython( path ):
|
||||||
"""Check if given path ends with a python 2.7 or 3.4+ name."""
|
"""Check if given path ends with a python 2.7 or 3.5+ name."""
|
||||||
return path and PYTHON_BINARY_REGEX.search( path ) is not None
|
return path and PYTHON_BINARY_REGEX.search( path ) is not None
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,9 +56,9 @@ def EndsWithPython_Python2Paths_test():
|
|||||||
def EndsWithPython_Python3Paths_test():
|
def EndsWithPython_Python3Paths_test():
|
||||||
python_paths = [
|
python_paths = [
|
||||||
'python3',
|
'python3',
|
||||||
'/usr/bin/python3.4',
|
'/usr/bin/python3.5',
|
||||||
'/home/user/.pyenv/shims/python3.4',
|
'/home/user/.pyenv/shims/python3.5',
|
||||||
r'C:\Python34\python.exe'
|
r'C:\Python35\python.exe'
|
||||||
]
|
]
|
||||||
|
|
||||||
for path in python_paths:
|
for path in python_paths:
|
||||||
|
@ -73,7 +73,7 @@ def YouCompleteMe_InvalidPythonInterpreterPath_test( post_vim_message ):
|
|||||||
post_vim_message.assert_called_once_with(
|
post_vim_message.assert_called_once_with(
|
||||||
"Unable to start the ycmd server. "
|
"Unable to start the ycmd server. "
|
||||||
"Path in 'g:ycm_server_python_interpreter' option does not point "
|
"Path in 'g:ycm_server_python_interpreter' option does not point "
|
||||||
"to a valid Python 2.7 or 3.4+. "
|
"to a valid Python 2.7 or 3.5+. "
|
||||||
"Correct the error then restart the server with ':YcmRestartServer'." )
|
"Correct the error then restart the server with ':YcmRestartServer'." )
|
||||||
|
|
||||||
post_vim_message.reset_mock()
|
post_vim_message.reset_mock()
|
||||||
@ -100,7 +100,7 @@ def YouCompleteMe_NoPythonInterpreterFound_test( post_vim_message, *args ):
|
|||||||
|
|
||||||
assert_that( ycm.IsServerAlive(), equal_to( False ) )
|
assert_that( ycm.IsServerAlive(), equal_to( False ) )
|
||||||
post_vim_message.assert_called_once_with(
|
post_vim_message.assert_called_once_with(
|
||||||
"Unable to start the ycmd server. Cannot find Python 2.7 or 3.4+. "
|
"Unable to start the ycmd server. Cannot find Python 2.7 or 3.5+. "
|
||||||
"Set the 'g:ycm_server_python_interpreter' option to a Python "
|
"Set the 'g:ycm_server_python_interpreter' option to a Python "
|
||||||
"interpreter path. "
|
"interpreter path. "
|
||||||
"Correct the error then restart the server with ':YcmRestartServer'." )
|
"Correct the error then restart the server with ':YcmRestartServer'." )
|
||||||
|
Loading…
Reference in New Issue
Block a user