Skip to content
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

Basic Python3 support #23

Merged
merged 4 commits into from
Aug 11, 2016
Merged

Basic Python3 support #23

merged 4 commits into from
Aug 11, 2016

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Jun 4, 2016

Addresses #22 on my machine. cc @burke

I don't expect this to get accepted as-is, but it compiles and runs using vim-with-python3 on my machine, so I figured it would be worth publishing as a first step.

Still todo:

  • support both python2 and python3 dynamically in vimscript
  • support both python2 and python3 dynamically in cmake based on vim --version
  • figure out which versions of python3 are (easy/worth) supporting (I happened to have 3.5 so that's what I set in cmake)

@eapache
Copy link
Contributor Author

eapache commented Jun 9, 2016

OK, I believe this is ready to go; it switches on python 2 and 3 everywhere so it should be usable with either now.

@nixprime
Copy link
Owner

Thank you very much for the contribution, and sorry for the long hiatus!

find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
if(PY3)
set(Python_ADDITIONAL_VERSIONS 3.5 3.4)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this also work with 3.3 (which I think is still moderately common)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, I just have no machine handy to test it on.

Also mention it in the README.
I have no way to test this but it should work and it's a fairly common version
still.
@nixprime
Copy link
Owner

Looks good, thanks again!

@nixprime nixprime merged commit ae094f4 into nixprime:master Aug 11, 2016
@eapache eapache deleted the python3 branch August 11, 2016 19:26
@eapache eapache mentioned this pull request Aug 11, 2016
@maximsch2
Copy link

This actually breaks neovim setup that supports both python2 and python3 together. It looks like python 2 version is being built (as I don't have python3-dev installed), but then vim portion detects that python3 is available and decides to use it (but there is no package for python3 built!).

nixprime added a commit that referenced this pull request Aug 16, 2016
Fixes #23 for neovim. I think.
@nixprime
Copy link
Owner

Hi @maximsch2, can you try the current master?

@maximsch2
Copy link

@nixprime I've tried it and it doesn't solve the issue (one thing is that it is calling vim in your script and at least for me neovim is nvim). I can solve it myself with PY3=ON now though, maybe python3-dev got installed somehow and now that the module is being built everything is working.

Is it possible to try calling both python2 and python3 versions in the cpsm.vim? That should solve the problem as it will work if at least one version of .so file was built.

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.

3 participants