Skip to content
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

Suport platforms where __file__ is not defined #2198

Merged
merged 1 commit into from Nov 11, 2019

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Nov 9, 2019

such as zipapp or PyOxidizer.

  • is_hypothesis_file will always return False, because hypothesis.__file__ is not defined. This weakens our traceback elision somewhat; it's clearly better than a crash but if we get a non-trivial user base on these platforms it's probably possible to do better.
  • Provisional strategies require one of Python 3.7+, __file__, or the importlib_resources backport to load the list of TLDs. Anyone in the third category is encouraged to contact us, because I'm not adding a conditional dependency without any evidence that it would actually be useful.

Closes #2196.

@Zac-HD Zac-HD added the interop how to play nicely with other packages label Nov 9, 2019
@Zac-HD Zac-HD force-pushed the no-__file__ branch 2 times, most recently from 5e43ecf to 2d703ec Compare November 9, 2019 09:33
Copy link
Contributor

@alexwlchan alexwlchan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

… of course __file__ isn't universally available.

That wtf moment from me aside, patch looks good. 👍

@Zac-HD Zac-HD merged commit 29976dc into HypothesisWorks:master Nov 11, 2019
@Zac-HD Zac-HD deleted the no-__file__ branch December 8, 2019 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop how to play nicely with other packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid use of __file__
2 participants