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

Support user install on Windows. #4005

Merged
merged 3 commits into from Sep 26, 2017

Conversation

Projects
None yet
6 participants
@ethanhs
Collaborator

ethanhs commented Sep 25, 2017

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.

This restores the usual data directory resolution on other platforms.

Correctly fixes #3988, and keeps other platforms working.

Support user install on Windows.
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.
@gvanrossum

Can you get rid of the map() call? It looks too clever an I don't trust it.

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs Sep 25, 2017

Collaborator

Removed. Mypy wasn't happy with the map call either.

Collaborator

ethanhs commented Sep 25, 2017

Removed. Mypy wasn't happy with the map call either.

@gvanrossum

I'd make prefixes a list. I'll wait until I can test it myself.

@ethanhs

This comment has been minimized.

Show comment
Hide comment
@ethanhs

ethanhs Sep 25, 2017

Collaborator

The Appveyor failure was the usual #3895

Collaborator

ethanhs commented Sep 25, 2017

The Appveyor failure was the usual #3895

@gvanrossum gvanrossum referenced this pull request Sep 25, 2017

Closed

Release 0.530 planning #4009

5 of 5 tasks complete
@ilevkivskyi

I just tried this PR on Linux, everything works.

@gvanrossum

OK, once AppVeyor passes I'll merge (or you may).

@Summertime

This comment has been minimized.

Show comment
Hide comment
@Summertime

Summertime Sep 26, 2017

Seems like it fixed the issue I was having, works for me!

Summertime commented Sep 26, 2017

Seems like it fixed the issue I was having, works for me!

@ilevkivskyi ilevkivskyi merged commit 9615b9e into python:master Sep 26, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@ethanhs ethanhs deleted the ethanhs:typeshedfix branch Sep 26, 2017

@davt

This comment has been minimized.

Show comment
Hide comment
@davt

davt Oct 18, 2017

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 commented Oct 18, 2017

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?

@JukkaL

This comment has been minimized.

Show comment
Hide comment
@JukkaL

JukkaL Oct 18, 2017

Collaborator

@davt Can you file a new issue for the virtualenv-on-Windows problem?

Collaborator

JukkaL commented Oct 18, 2017

@davt Can you file a new issue for the virtualenv-on-Windows problem?

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