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

Error on Python 3.5.1: TypeError: Bound must be a type. Got <built-in function callable>. #2318

Closed
blueyed opened this issue Jan 11, 2020 · 1 comment · Fixed by #2315
Closed
Labels
bug something is clearly wrong here

Comments

@blueyed
Copy link
Contributor

blueyed commented Jan 11, 2020

Using hypothesis 5.1.4 with Python 3.5.1:

Traceback (most recent call last):
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/bin/pytest", line 8, in <module>
    sys.exit(main())
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 72, in main
    config = _prepareconfig(args, plugins)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 223, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/hooks.py", line 286, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 93, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 87, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 793, in pytest_cmdline_parse
    self.parse(args)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 999, in parse
    self._preparse(args, addopts=addopts)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/config/__init__.py", line 947, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/pluggy/manager.py", line 299, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/importlib_metadata/__init__.py", line 94, in load
    module = import_module(match.group('module'))
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/__init__.py", line 24, in <module>
    from hypothesis._settings import HealthCheck, Phase, Verbosity, settings
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/_settings.py", line 37, in <module>
    from hypothesis.internal.reflection import get_pretty_function_description
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/_pytest/assertion/rewrite.py", line 143, in exec_module
    exec(co, module.__dict__)
  File "/home/travis/build/pytest-dev/pytest/.tox/py35-xdist/lib/python3.5/site-packages/hypothesis/internal/reflection.py", line 37, in <module>
    C = TypeVar("C", bound=callable)
  File "/opt/python/3.5.1/lib/python3.5/typing.py", line 405, in __new__
    self.__bound__ = _type_check(bound, "Bound must be a type.")
  File "/opt/python/3.5.1/lib/python3.5/typing.py", line 299, in _type_check
    raise TypeError(msg + " Got %.100r." % (arg,))
TypeError: Bound must be a type. Got <built-in function callable>.

(via pytest-dev/pytest#6440 (comment))

@Zac-HD Zac-HD added the bug something is clearly wrong here label Jan 12, 2020
@Zac-HD
Copy link
Member

Zac-HD commented Jan 12, 2020

Hmm, looks like we need a CI job for Python 3.5.0 😬

(note to other maintainers: technically we don't promise support for older patch versions of Python, but IMO we ought to start by fixing this and either keep it fixed or bump the python_requires to >= 3.5.2 and I prefer the former until we drop 3.5 entirely)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants