Skip to content

Commit

Permalink
Auto merge of #2887 - bstaletic:drop_python26_and_33, r=micbou
Browse files Browse the repository at this point in the history
[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 ycm-core/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 -->
  • Loading branch information
zzbot authored Feb 1, 2018
2 parents 9aa754c + 605ef42 commit d0c6b61
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- *run-tests
- *upload-coverage
environment:
YCMD_PYTHON_VERSION: 3.3
YCMD_PYTHON_VERSION: 3.4
workflows:
version: 2
build:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ eval "$(pyenv init -)"
if [ "${YCMD_PYTHON_VERSION}" == "2.7" ]; then
# We need a recent enough version of Python 2.7 on macOS or an error occurs
# when installing the psutil dependency for our tests.
PYENV_VERSION="2.7.8"
PYENV_VERSION="2.7.14"
else
PYENV_VERSION="3.3.6"
PYENV_VERSION="3.4.7"
fi

# In order to work with ycmd, python *must* be built as a shared library. The
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ env:
- YCM_CORES=3
- COVERAGE=true
matrix:
- YCM_PYTHON_VERSION=2.6
- YCM_PYTHON_VERSION=2.7
- YCM_PYTHON_VERSION=3.3
- YCM_PYTHON_VERSION=3.4
addons:
apt:
sources:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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][]
completion library. Specify the Python interpreter to use to get completions.
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: `''`

Expand Down
10 changes: 4 additions & 6 deletions ci/travis/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ if [ ! -d "${PYENV_ROOT}/.git" ]; then
fi
pushd ${PYENV_ROOT}
git fetch --tags
git checkout v1.0.8
git checkout v1.2.1
popd

export PATH="${PYENV_ROOT}/bin:${PATH}"

eval "$(pyenv init -)"

if [ "${YCM_PYTHON_VERSION}" == "2.6" ]; then
PYENV_VERSION="2.6.6"
elif [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
PYENV_VERSION="2.7.6"
if [ "${YCM_PYTHON_VERSION}" == "2.7" ]; then
PYENV_VERSION="2.7.14"
else
PYENV_VERSION="3.3.6"
PYENV_VERSION="3.4.7"
fi

# In order to work with ycmd, python *must* be built as a shared library. This
Expand Down
2 changes: 1 addition & 1 deletion doc/youcompleteme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,7 @@ The *g:ycm_python_binary_path* option
This option specifies the Python interpreter to use to run the jedi [12]
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
Python 2.6, 2.7 or 3.3+).
Python 2.7 or 3.4+).

Default: "''"
>
Expand Down
2 changes: 1 addition & 1 deletion plugin/youcompleteme.vim
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ elseif !has( 'timers' )
elseif !has( 'python' ) && !has( 'python3' )
echohl WarningMsg |
\ echomsg "YouCompleteMe unavailable: requires Vim compiled with " .
\ "Python (2.6+ or 3.3+) support." |
\ "Python (2.7 or 3.4+) support." |
\ echohl None
call s:restore_cpo()
finish
Expand Down
4 changes: 1 addition & 3 deletions python/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Flake8 3.x dropped support of Python 2.6 and 3.3
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'
flake8 >= 3.0.0
mock >= 1.0.1
nose >= 1.3.7
PyHamcrest >= 1.8.0
Expand Down
6 changes: 3 additions & 3 deletions python/ycm/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def PathToPythonInterpreter():
return python_interpreter

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()
if python_interpreter and utils.GetExecutable( python_interpreter ):
Expand All @@ -77,7 +77,7 @@ def PathToPythonInterpreter():
if 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 "
"to a Python interpreter path." )

Expand All @@ -94,7 +94,7 @@ def _PathToPythonUsedDuringBuild():


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


Expand Down
10 changes: 5 additions & 5 deletions python/ycm/tests/paths_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def EndsWithPython_Python2Paths_test():
python_paths = [
'python',
'python2',
'/usr/bin/python2.6',
'/usr/bin/python2.7',
'/home/user/.pyenv/shims/python2.7',
r'C:\Python26\python.exe',
r'C:\Python27\python.exe',
'/Contents/MacOS/Python'
]

Expand All @@ -56,9 +56,9 @@ def EndsWithPython_Python2Paths_test():
def EndsWithPython_Python3Paths_test():
python_paths = [
'python3',
'/usr/bin/python3.3',
'/home/user/.pyenv/shims/python3.3',
r'C:\Python33\python.exe'
'/usr/bin/python3.4',
'/home/user/.pyenv/shims/python3.4',
r'C:\Python34\python.exe'
]

for path in python_paths:
Expand Down
4 changes: 2 additions & 2 deletions python/ycm/tests/youcompleteme_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def YouCompleteMe_InvalidPythonInterpreterPath_test( post_vim_message ):
post_vim_message.assert_called_once_with(
"Unable to start the ycmd server. "
"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'." )

post_vim_message.reset_mock()
Expand All @@ -81,7 +81,7 @@ def YouCompleteMe_NoPythonInterpreterFound_test( post_vim_message, *args ):
ycm = YouCompleteMe( MakeUserOptions() )
assert_that( ycm.IsServerAlive(), equal_to( False ) )
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 "
"interpreter path. "
"Correct the error then restart the server with ':YcmRestartServer'." )
Expand Down
9 changes: 2 additions & 7 deletions run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@
def RunFlake8():
print( 'Running flake8' )
subprocess.check_call( [
sys.executable,
# __main__ is required on Python 2.6.
'-m', 'flake8.__main__',
p.join( DIR_OF_THIS_SCRIPT, 'python' )
sys.executable, '-m', 'flake8', p.join( DIR_OF_THIS_SCRIPT, 'python' )
] )


Expand Down Expand Up @@ -86,9 +83,7 @@ def NoseTests( parsed_args, extra_nosetests_args ):
else:
nosetests_args.append( p.join( DIR_OF_THIS_SCRIPT, 'python' ) )

subprocess.check_call( [ sys.executable,
# __main__ is required on Python 2.6.
'-m', 'nose.__main__' ] + nosetests_args )
subprocess.check_call( [ sys.executable, '-m', 'nose' ] + nosetests_args )


def Main():
Expand Down

0 comments on commit d0c6b61

Please sign in to comment.