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

hypothesis --version does not work #2604

Closed
sobolevn opened this issue Sep 6, 2020 · 3 comments · Fixed by #2605
Closed

hypothesis --version does not work #2604

sobolevn opened this issue Sep 6, 2020 · 3 comments · Fixed by #2605

Comments

@sobolevn
Copy link
Member

sobolevn commented Sep 6, 2020

When I use pip install hypothesis in a clear env and run hypothesis --version, this happens:

» hypothesis --version
Traceback (most recent call last):
  File "/Users/sobolev/Documents/github/returns/.venv/bin/hypothesis", line 6, in <module>
    from hypothesis.extra.cli import main
  File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/hypothesis/extra/cli.py", line 35, in <module>
    from hypothesis.extra import ghostwriter
  File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/hypothesis/extra/ghostwriter.py", line 57, in <module>
    import black
ModuleNotFoundError: No module named 'black'

Looks like black is treated as a required dependency right now.

After installing black:

» hypothesis --version
hypothesis, version 5.33.0
@Julian-O
Copy link
Contributor

Julian-O commented Sep 6, 2020

Looking at setup.py, it looks like if you want to call the command line, you should install the [cli] extra, which installs black and click. See more here

@sobolevn
Copy link
Member Author

sobolevn commented Sep 6, 2020

@Julian-O yes. But, click is handled differently: https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/src/hypothesis/extra/cli.py#L41

@Julian-O
Copy link
Contributor

Julian-O commented Sep 6, 2020

Interesting. Would it be appropriate to catch an import error where you do now import black, with a similar warning?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants