-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix test_typed_pkg test failure on Mac #4888
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
if hasattr(sys, 'real_prefix'): | ||
return True | ||
else: | ||
# https://github.com/python/typeshed/pull/2047 |
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 merged that typeshed PR, but yet another typeshed sync is also needed.
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 was expecting that we'd just merge this to get mypy master back in a good state. I can send another small PR to remove the type ignore later.
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.
(Actually I propose not to cp that onto the release branch, since the # type: ignore
below silences the error. We can fix things on the master branch.)
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'll let @ethanhs review and merge onto master. Once merged I'll cherry-pick this PR into the release-0.590 branch.
if hasattr(sys, 'real_prefix'): | ||
return True | ||
else: | ||
# https://github.com/python/typeshed/pull/2047 |
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.
(Actually I propose not to cp that onto the release branch, since the # type: ignore
below silences the error. We can fix things on the master branch.)
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.
LGTM! Thanks for the fix.
So apparently the repro was to run the test *twice*...
I'm a little sad this test uses and modifies the environment.
…On Wed, Apr 11, 2018, 15:10 Ethan Smith ***@***.***> wrote:
Merged #4888 <#4888>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4888 (comment)>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/ACwrMrAMdQeOyhRBUbrDd9D7EeGWPvziks5tnn86gaJpZM4TQRjl>
.
|
Well, run the test twice in an environment where the global/user site packages directory was available from a virtualenv. In all of my testing environments, the tests could be run twice without failure.
Yes, it is less than ideal. I am working on a version that creates, uses, then destroys a virtualenv of its own. |
That might also be tricky, because on Python 2 you need to install the third-party |
I mean our Python 2 tests already depend on it having |
I cherry-picked this into release-0.590, but not #4884 (which you created to debug this). And I'm not going to cp the typeshed change for |
Fixes #4883
The check for whether we're in a venv turns out to be unreliable. See https://stackoverflow.com/questions/1871549/determine-if-python-is-running-inside-virtualenv for background.
Note that if you're testing this on a Mac that previously ran into the bug, you'll have to manually remove any global typedpkg installs for the test to work.