Drop Python 2.6 and Python 3.3

This commit is contained in:
Boris Staletic 2018-01-24 17:54:57 +01:00 committed by Boris Staletic
parent d183f11fa7
commit 605ef42cd6
12 changed files with 24 additions and 34 deletions

View File

@ -54,7 +54,7 @@ jobs:
- *run-tests - *run-tests
- *upload-coverage - *upload-coverage
environment: environment:
YCMD_PYTHON_VERSION: 3.3 YCMD_PYTHON_VERSION: 3.4
workflows: workflows:
version: 2 version: 2
build: build:

View File

@ -49,9 +49,9 @@ eval "$(pyenv init -)"
if [ "${YCMD_PYTHON_VERSION}" == "2.7" ]; then if [ "${YCMD_PYTHON_VERSION}" == "2.7" ]; then
# We need a recent enough version of Python 2.7 on macOS or an error occurs # We need a recent enough version of Python 2.7 on macOS or an error occurs
# when installing the psutil dependency for our tests. # when installing the psutil dependency for our tests.
PYENV_VERSION="2.7.8" PYENV_VERSION="2.7.14"
else else
PYENV_VERSION="3.3.6" PYENV_VERSION="3.4.7"
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

View File

@ -14,9 +14,8 @@ env:
- YCM_CORES=3 - YCM_CORES=3
- COVERAGE=true - COVERAGE=true
matrix: matrix:
- YCM_PYTHON_VERSION=2.6
- YCM_PYTHON_VERSION=2.7 - YCM_PYTHON_VERSION=2.7
- YCM_PYTHON_VERSION=3.3 - YCM_PYTHON_VERSION=3.4
addons: addons:
apt: apt:
sources: sources:

View File

@ -2607,7 +2607,7 @@ let g:ycm_disable_for_files_larger_than_kb = 1000
This option specifies the Python interpreter to use to run the [jedi][] This option specifies the Python interpreter to use to run the [jedi][]
completion library. Specify the Python interpreter to use to get completions. completion library. Specify the Python interpreter to use to get completions.
By default the Python under which [ycmd][] runs is used ([ycmd][] runs on By default the Python under which [ycmd][] runs is used ([ycmd][] runs on
Python 2.6, 2.7 or 3.3+). Python 2.7 or 3.4+).
Default: `''` Default: `''`

View File

@ -33,19 +33,17 @@ if [ ! -d "${PYENV_ROOT}/.git" ]; then
fi fi
pushd ${PYENV_ROOT} pushd ${PYENV_ROOT}
git fetch --tags git fetch --tags
git checkout v1.0.8 git checkout v1.2.1
popd popd
export PATH="${PYENV_ROOT}/bin:${PATH}" export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)" eval "$(pyenv init -)"
if [ "${YCM_PYTHON_VERSION}" == "2.6" ]; then if [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
PYENV_VERSION="2.6.6" PYENV_VERSION="2.7.14"
elif [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
PYENV_VERSION="2.7.6"
else else
PYENV_VERSION="3.3.6" PYENV_VERSION="3.4.7"
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

View File

@ -2848,7 +2848,7 @@ The *g:ycm_python_binary_path* option
This option specifies the Python interpreter to use to run the jedi [12] This option specifies the Python interpreter to use to run the jedi [12]
completion library. Specify the Python interpreter to use to get completions. completion library. Specify the Python interpreter to use to get completions.
By default the Python under which ycmd [45] runs is used (ycmd [45] runs on By default the Python under which ycmd [45] runs is used (ycmd [45] runs on
Python 2.6, 2.7 or 3.3+). Python 2.7 or 3.4+).
Default: "''" Default: "''"
> >

View File

@ -57,7 +57,7 @@ elseif !has( 'timers' )
elseif !has( 'python' ) && !has( 'python3' ) elseif !has( 'python' ) && !has( 'python3' )
echohl WarningMsg | echohl WarningMsg |
\ echomsg "YouCompleteMe unavailable: requires Vim compiled with " . \ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
\ "Python (2.6+ or 3.3+) support." | \ "Python (2.7 or 3.4+) support." |
\ echohl None \ echohl None
call s:restore_cpo() call s:restore_cpo()
finish finish

View File

@ -1,6 +1,4 @@
# Flake8 3.x dropped support of Python 2.6 and 3.3 flake8 >= 3.0.0
flake8 < 3.0.0; python_version == '2.6' or python_version == '3.3'
flake8 >= 3.0.0; python_version == '2.7' or python_version > '3.3'
mock >= 1.0.1 mock >= 1.0.1
nose >= 1.3.7 nose >= 1.3.7
PyHamcrest >= 1.8.0 PyHamcrest >= 1.8.0

View File

@ -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.6+ or 3.3+." ) "does not point to a valid Python 2.7 or 3.4+." )
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.6+ or 3.3+. " raise RuntimeError( "Cannot find Python 2.7 or 3.4+. "
"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.6+ or 3.3+ name.""" """Check if given path ends with a python 2.7 or 3.4+ name."""
return path and PYTHON_BINARY_REGEX.search( path ) is not None return path and PYTHON_BINARY_REGEX.search( path ) is not None

View File

@ -43,9 +43,9 @@ def EndsWithPython_Python2Paths_test():
python_paths = [ python_paths = [
'python', 'python',
'python2', 'python2',
'/usr/bin/python2.6', '/usr/bin/python2.7',
'/home/user/.pyenv/shims/python2.7', '/home/user/.pyenv/shims/python2.7',
r'C:\Python26\python.exe', r'C:\Python27\python.exe',
'/Contents/MacOS/Python' '/Contents/MacOS/Python'
] ]
@ -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.3', '/usr/bin/python3.4',
'/home/user/.pyenv/shims/python3.3', '/home/user/.pyenv/shims/python3.4',
r'C:\Python33\python.exe' r'C:\Python34\python.exe'
] ]
for path in python_paths: for path in python_paths:

View File

@ -55,7 +55,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.6+ or 3.3+. " "to a valid Python 2.7 or 3.4+. "
"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()
@ -81,7 +81,7 @@ def YouCompleteMe_NoPythonInterpreterFound_test( post_vim_message, *args ):
ycm = YouCompleteMe( MakeUserOptions() ) ycm = YouCompleteMe( MakeUserOptions() )
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.6+ or 3.3+. " "Unable to start the ycmd server. Cannot find Python 2.7 or 3.4+. "
"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'." )

View File

@ -38,10 +38,7 @@ import argparse
def RunFlake8(): def RunFlake8():
print( 'Running flake8' ) print( 'Running flake8' )
subprocess.check_call( [ subprocess.check_call( [
sys.executable, sys.executable, '-m', 'flake8', p.join( DIR_OF_THIS_SCRIPT, 'python' )
# __main__ is required on Python 2.6.
'-m', 'flake8.__main__',
p.join( DIR_OF_THIS_SCRIPT, 'python' )
] ) ] )
@ -86,9 +83,7 @@ def NoseTests( parsed_args, extra_nosetests_args ):
else: else:
nosetests_args.append( p.join( DIR_OF_THIS_SCRIPT, 'python' ) ) nosetests_args.append( p.join( DIR_OF_THIS_SCRIPT, 'python' ) )
subprocess.check_call( [ sys.executable, subprocess.check_call( [ sys.executable, '-m', 'nose' ] + nosetests_args )
# __main__ is required on Python 2.6.
'-m', 'nose.__main__' ] + nosetests_args )
def Main(): def Main():