You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Symbolic links to submodules breaks python-mode on Windows #837
Installing python-mode in vim on Windows (using Vundle) checks out the git repo. Symlinks aren't supported on Windows (at least by git and not in any nice way in general). Therefore the pymode/libs directory, which has symlinks to the libraries in the submodules directory doesn't work on Windows and no python libraries can be imported.
I was aware that this could be a problem for vim users in Windows and took quite a while for this to show up (meaning that our Windows user base is rather small). Maintaining a project for different OSes places additional burden on our scarce development team.
To be very honest with you I don't have time to work on this issue for now. I do apologize for that. So I either suggest you to checkout an older version of python-mode which does not have symlinks (around the d2dead6ce9d900b26dbf1a06c52969f4194eda64 commit, from @klen) or help us implementing a solution. A nice place to start is here:
I was trying to think of workarounds and wondered if .pth files might hold a solution. I also wondered if we could add the folders under submodules directly to the python path in python-mode.
I actually got it working on Windows by getting git to generate symlinks but it's not pretty. Under Windows you need to turn on symlinks in the git config (core.symlinks) and then checkout as an admin user (because you need a special permission to create symlinks on Windows).
This doesn't work well with Vundle or any other package manager but to be honest, the submodules didn't work with Vundle anyway (even on my linux machine) and required me to manually update the
submodules so perhaps that's another issue that needs raising separately.
I know this whole procedure is cumbersome. Actually I have no idea why you need admin rights to make symlinks on Windows... Windows puzzles me everyday I have to deal with it.
As of vim8 there is a recommended package structure (:help packages) so notwithstanding the popularity of package managers for vim I'll favor the official method.
I'll take a look at this .pth possibility but I have never heard of it.
@wangcgfan solution proposal, if it does not causes problems on VIM itself or other extensions, and it work on other OSs, then it looks like a possible workaround for now.
@wangcgfan Make a PR with the proposed solution so we can see how it perform on Travis CI tests.
While writing the previous comment, I have had and idea, but I still have to take a better look at our source code to see if it make sense.
We may make two main changes that would fix this problems with symlinks.
The first one is to use the linters directly from our submodules directory. (or may be rename it to something like external).
The second one it to make our code always use pylama and other linters from within python-mode python module.
Which means.
Instead of doing: from pylama.lint.extensions import LINTERS, we may do from python_mode.pylama.lint.extensions import LINTERS (or something like that), in order to be sure that we are using every linter and module on the expected version instead of a version installed on the OS or virtualenv.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
fmv1992 commentedon Jan 20, 2018
Thanks @jondye for reporting this bug.
I was aware that this could be a problem for vim users in Windows and took quite a while for this to show up (meaning that our Windows user base is rather small). Maintaining a project for different OSes places additional burden on our scarce development team.
To be very honest with you I don't have time to work on this issue for now. I do apologize for that. So I either suggest you to checkout an older version of
python-modewhich does not have symlinks (around thed2dead6ce9d900b26dbf1a06c52969f4194eda64commit, from @klen) or help us implementing a solution. A nice place to start is here:https://stackoverflow.com/questions/5917249/git-symlinks-in-windows
Best,
kierun commentedon Jan 23, 2018
I think I am hitting the same bug but only on one of the two windows machines I use. Thought it was related to dein at first.
Do you need anything to help debug/test?
jondye commentedon Jan 23, 2018
@fmv1992 I though you'd say that :-)
I was trying to think of workarounds and wondered if .pth files might hold a solution. I also wondered if we could add the folders under submodules directly to the python path in python-mode.
I actually got it working on Windows by getting git to generate symlinks but it's not pretty. Under Windows you need to turn on symlinks in the git config (
core.symlinks) and then checkout as an admin user (because you need a special permission to create symlinks on Windows).This doesn't work well with Vundle or any other package manager but to be honest, the submodules didn't work with Vundle anyway (even on my linux machine) and required me to manually update the
submodules so perhaps that's another issue that needs raising separately.
kierun commentedon Jan 23, 2018
Just reverted to
d2dead6ce9d900b26dbf1a06c52969f4194eda64and I indeed do not see the error. So, at least that's a work around, if inadequate.fmv1992 commentedon Jan 25, 2018
@jondye,
I know this whole procedure is cumbersome. Actually I have no idea why you need admin rights to make symlinks on Windows... Windows puzzles me everyday I have to deal with it.
As of vim8 there is a recommended package structure (
:help packages) so notwithstanding the popularity of package managers for vim I'll favor the official method.I'll take a look at this
.pthpossibility but I have never heard of it.Thanks for your understanding.
chanfried commentedon Feb 11, 2018
I add submodules's path to sys.path in "python-mode\pymode\lint.py".
it works for windows 10 ,not test for other OS
Is it a acceptable solution ?
diraol commentedon Feb 11, 2018
@wangcgfan solution proposal, if it does not causes problems on VIM itself or other extensions, and it work on other OSs, then it looks like a possible workaround for now.
@wangcgfan Make a PR with the proposed solution so we can see how it perform on Travis CI tests.
diraol commentedon Feb 11, 2018
While writing the previous comment, I have had and idea, but I still have to take a better look at our source code to see if it make sense.
We may make two main changes that would fix this problems with symlinks.
The first one is to use the linters directly from our submodules directory. (or may be rename it to something like
external).The second one it to make our code always use pylama and other linters from within
python-modepython module.Which means.
Instead of doing:
from pylama.lint.extensions import LINTERS, we may dofrom python_mode.pylama.lint.extensions import LINTERS(or something like that), in order to be sure that we are using every linter and module on the expected version instead of a version installed on the OS or virtualenv.This is just a high level ideal for now!
stale commentedon Jul 11, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stale commentedon Aug 1, 2018
Closed due to inactivity.