Skip to content

Symbolic links to submodules breaks python-mode on Windows #837

Closed

Description

@jondye

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.

Activity

  1. fmv1992 commented on Jan 20, 2018

    @fmv1992
    Contributor

    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-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:

    https://stackoverflow.com/questions/5917249/git-symlinks-in-windows

    Best,

  2. kierun commented on Jan 23, 2018

    @kierun

    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?

  3. jondye commented on Jan 23, 2018

    @jondye
    Author

    @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.

  4. kierun commented on Jan 23, 2018

    @kierun

    Just reverted to d2dead6ce9d900b26dbf1a06c52969f4194eda64 and I indeed do not see the error. So, at least that's a work around, if inadequate.

  5. fmv1992 commented on Jan 25, 2018

    @fmv1992
    Contributor

    @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 .pth possibility but I have never heard of it.

    Thanks for your understanding.

  6. chanfried commented on Feb 11, 2018

    @chanfried

    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 ?

    2018-02-11_16-45-37

  7. diraol commented on Feb 11, 2018

    @diraol
    Contributor

    @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.

  8. diraol commented on Feb 11, 2018

    @diraol
    Contributor

    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 is just a high level ideal for now!

  9. stale commented on Jul 11, 2018

    @stale

    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.

  10. stale commented on Aug 1, 2018

    @stale

    Closed due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions