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

Fix broken installation on Windows in virtualenv #4149

Merged
merged 1 commit into from Oct 25, 2017

Conversation

Projects
None yet
4 participants
@AleksanderGondek
Contributor

AleksanderGondek commented Oct 22, 2017

Fixes #4142
Python site.py from any virtualenv does not contain many functions added in python 2.7 (see: pypa/virtualenv#355), which results in method site.getsitepackages being absent.

This commit replaces getsitepackages call with equivalent of distutils.sysconfig.get_python_lib which is supported in virtualenv.

@gvanrossum

This comment has been minimized.

Show comment
Hide comment
@gvanrossum

gvanrossum Oct 22, 2017

Member

@ethanhs Can you review/test this?

Member

gvanrossum commented Oct 22, 2017

@ethanhs Can you review/test this?

Show outdated Hide outdated mypy/build.py
Fix broken installation on Windows in virtualenv
Fixes #4142. Python `site.py` from any virtualenv does not contain many functions added in python 2.7 (see: pypa/virtualenv#355), which results in method `site.getsitepackages` being absent.

This commit replaces getsitepackages call with equivalent of `distutils.sysconfig.get_python_lib` which is supported in virtualenv.
@AleksanderGondek

This comment has been minimized.

Show comment
Hide comment
@AleksanderGondek

AleksanderGondek Oct 25, 2017

Contributor

Ping

Contributor

AleksanderGondek commented Oct 25, 2017

Ping

@gvanrossum

This comment has been minimized.

Show comment
Hide comment
@gvanrossum

gvanrossum Oct 25, 2017

Member
Member

gvanrossum commented Oct 25, 2017

@AleksanderGondek

This comment has been minimized.

Show comment
Hide comment
@AleksanderGondek

AleksanderGondek Oct 25, 2017

Contributor

I was just wondering if we could merge the change - I have adjusted it accordingly to ethanhs advice.
Sorry if this is being too pushy, but it pains me to not have mypy working on Windows in virtualenv :)

Contributor

AleksanderGondek commented Oct 25, 2017

I was just wondering if we could merge the change - I have adjusted it accordingly to ethanhs advice.
Sorry if this is being too pushy, but it pains me to not have mypy working on Windows in virtualenv :)

@gvanrossum

This comment has been minimized.

Show comment
Hide comment
@gvanrossum

gvanrossum Oct 25, 2017

Member
Member

gvanrossum commented Oct 25, 2017

@AleksanderGondek

This comment has been minimized.

Show comment
Hide comment
@AleksanderGondek

AleksanderGondek Oct 25, 2017

Contributor

Apologies - I have not intended to be disrespectful. I fully appreciate free time put into the project. I will now cease to spam and thanks for clarifying things for me .

Contributor

AleksanderGondek commented Oct 25, 2017

Apologies - I have not intended to be disrespectful. I fully appreciate free time put into the project. I will now cease to spam and thanks for clarifying things for me .

@ethanhs

Thank you for fixing this.

@ilevkivskyi ilevkivskyi merged commit 4a10e05 into python:master Oct 25, 2017

2 checks passed

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

JukkaL added a commit that referenced this pull request Oct 31, 2017

Fix broken installation on Windows in virtualenv (#4149)
Fixes #4142. Python `site.py` from any virtualenv does not contain
many functions added in python 2.7
(see: pypa/virtualenv#355), which results in
method `site.getsitepackages` being absent.

This commit replaces getsitepackages call with equivalent of
`distutils.sysconfig.get_python_lib` which is supported in virtualenv.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment