Skip to content

Remove support for Python2 #1129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 5, 2019
Merged

Remove support for Python2 #1129

merged 7 commits into from
Nov 5, 2019

Conversation

SirVer
Copy link
Owner

@SirVer SirVer commented Nov 5, 2019

Python 3 is > 10 years old and Python 2 will no longer be supported in a few months. Time to get rid of it, simplifying the code base (slightly) and opening the opportunities to use the Py3 quality of life improvements.

@SirVer SirVer changed the title WIP: Remove support for Python2 Remove support for Python2 Nov 5, 2019
@SirVer SirVer merged commit d2f42d6 into master Nov 5, 2019
@SirVer SirVer deleted the 00_gut_python2 branch November 5, 2019 21:17
@rubin55
Copy link

rubin55 commented Nov 12, 2019

Quick quip here, say, macOS Mojave still comes with Python 2.7 as the default python + MacVim is linked against that. I suddenly was getting large swaths of errors and I think it is because of the removal of python2 support from UltiSnips a few days ago.

Long story short: UltiSnips won't work out of the box anymore on macOS, up and including current Catalina (10.15). For more info about what apple will do post 10.16, see here btw: https://www.macobserver.com/analysis/macos-catalina-deprecates-unix-scripting-languages/

While I appreciate that Python 2.x is dead as a doorknob, this change is, from the perspective of a mac user in the coming 1.5 years, not the best one ever.

@SirVer
Copy link
Owner Author

SirVer commented Nov 12, 2019

@rubin55 Thanks for raising your concerns!

I am a full time mac user and it seems reasonable to me to expect people to brew install macvim or similar to get access to Vim. I will no longer support Python2 going forward.

Another reasonable option is to pin to the 3.2 release of UltiSnips which still supports Python2.

SirVer pushed a commit that referenced this pull request Nov 13, 2019
This was broken in #1129 through a search & replaco. 

Fixes #1139.
@patrick96
Copy link

Hi, I just wanted to report that this broke my VIM on some occasions.

The issue was that some plugins call has('python') to figure out whether or not to use python. But by calling that function it loads python2 if it is available. After that ultisnips spews This Vim cannot execute :py3 after using :python errors. I was able to fix this by adding call has('python3') at the top of my .vimrc.

The real solution would of course be for every plugin to first call has('python3') before it calls has('python') (if it supports python3), but that is not your problem 😉

Just wanted to let you know and maybe help other people that stumble upon this issue.

@ZSaberLv0
Copy link

mac os still comes with python2.7 as default, so I suggest at least place some info in doc or README about python2 compatibility (using old release/tag/branch, etc)

@SirVer
Copy link
Owner Author

SirVer commented Dec 6, 2019

@ZSaberLv0 Could you send a Pull request where you would have searched for such information and how you would have liked it to be phrased?

@ZSaberLv0
Copy link

ZSaberLv0 commented Dec 17, 2019

I think the best solution for now, is using vim-plug like this

if has('python3')
    Plug 'SirVer/ultisnips'
elseif has('python')
    Plug 'SirVer/ultisnips', {
        \   'tag': '3.2',
        \   'dir': get(g:, 'plug_home', '~/.vim/bundle') . '/ultisnips_py2',
        \ }
endif

@jordwalke
Copy link

jordwalke commented Sep 23, 2020

It's really unfortunate that this change was made because MacVim is distributed as a prebuilt binary and OSX still only comes with 2.7 installed. Many MacVim (maybe the largest portion) do not install MacVim through brew. I can pin to 3.2, but it's harder to recommend that other people pin to 3.2 when communicating instructions for setting up a decent Vim environment and sharing those instructions with people. I understand the tradeoffs here and maybe you're making the right call - just wanted to provide an explanation of how many people might be troubled by this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants