Auto merge of #2887 - bstaletic:drop_python26_and_33, r=micbou
[READY] Drop Python 2.6 and Python 3.3 # PR Prelude Thank you for working on YCM! :) **Please complete these steps and check these boxes (by putting an `x` inside the brackets) _before_ filing your PR:** - [x] I have read and understood YCM's [CONTRIBUTING][cont] document. - [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document. - [x] I have included tests for the changes in my PR. If not, I have included a rationale for why I haven't. - [x] **I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.** # Why this change is necessary and useful [Please explain **in detail** why the changes in this PR are needed.] Since we are dropping support for Python 2.6 and 3.3 in Valloric/ycmd#904 we should drop support for them in YCM as well. [cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md [code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md <!-- 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/2887) <!-- Reviewable:end -->
This commit is contained in:
commit
d0c6b6186e
@ -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:
|
||||||
|
@ -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
|
||||||
|
@ -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:
|
||||||
|
@ -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: `''`
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
@ -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: "''"
|
||||||
>
|
>
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
@ -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:
|
||||||
|
@ -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'." )
|
||||||
|
@ -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():
|
||||||
|
Loading…
Reference in New Issue
Block a user