-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Support user install on Windows. #4005
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
Conversation
On Windows, the usual install paths are sys.prefix/Lib/mypy for a global install. For user installs, the path is site.getuserbase()/lib/mypy. We also fall back to the old method of installation due to the data dir being put in the package directory on an egg install.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you get rid of the map() call? It looks too clever an I don't trust it.
Removed. Mypy wasn't happy with the map call either. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make prefixes a list. I'll wait until I can test it myself.
The Appveyor failure was the usual #3895 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried this PR on Linux, everything works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, once AppVeyor passes I'll merge (or you may).
Seems like it fixed the issue I was having, works for me! |
Be aware that this change as shipped in 0.530 (installed from pypi) breaks when run under virtualenv on Windows. The underlying reason is that - for reasons I don't understand - virtualenv overwrites Lib/site.py with an old version which does not include the function site.getuserbase(). Would a direct call to sysconfig.get_config_var('userbase') be a suitable workaround? |
@davt Can you file a new issue for the virtualenv-on-Windows problem? |
On Windows, the usual install paths are
sys.prefix/Lib/mypy
for a globalinstall. For user installs, the path is
site.getuserbase()/lib/mypy
. Wealso fall back to the old method of installation due to the data dir being
put in the package directory on an egg install.
This restores the usual data directory resolution on other platforms.
Correctly fixes #3988, and keeps other platforms working.