You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(starlite-hello-world-nPMVAxaQ-py3.10) peter@peter-Inspiron-15-5510:~/PycharmProjects/starlite-hello-world$ poetry run uvicorn main:app
Traceback (most recent call last):
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/bin/uvicorn", line 8, in <module>
sys.exit(main())
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/click/core.py", line 1130, in __call__returnself.main(*args, **kwargs)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv =self.invoke(ctx)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/click/core.py", line 1404, in invokereturn ctx.invoke(self.callback, **ctx.params)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/click/core.py", line 760, in invokereturn __callback(*args, **kwargs)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 407, in main
run(
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/main.py", line 575, in run
server.run()
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 60, in runreturn asyncio.run(self.serve(sockets=sockets))
File "/home/peter/.pyenv/versions/3.10.5/lib/python3.10/asyncio/runners.py", line 44, in runreturn loop.run_until_complete(main)
File "/home/peter/.pyenv/versions/3.10.5/lib/python3.10/asyncio/base_events.py", line 646, in run_until_completereturn future.result()
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/server.py", line 67, in serve
config.load()
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/config.py", line 479, in loadself.loaded_app = import_from_string(self.app)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
File "/home/peter/.pyenv/versions/3.10.5/lib/python3.10/importlib/__init__.py", line 126, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/peter/PycharmProjects/starlite-hello-world/./main.py", line 15, in <module>
app = Starlite(route_handlers=[hello_world])
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/starlite/app.py", line 165, in __init__super().__init__(
File "pydantic/decorator.py", line 40, in pydantic.decorator.validate_arguments.validate.wrapper_function
File "pydantic/decorator.py", line 134, in pydantic.decorator.ValidatedFunction.call
File "pydantic/decorator.py", line 201, in pydantic.decorator.ValidatedFunction.execute
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/starlite/router.py", line 134, in __init__self.register(value=route_handler)
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/starlite/app.py", line 231, in register
route_handler.resolve_response_handler()
File "/home/peter/.cache/pypoetry/virtualenvs/starlite-hello-world-nPMVAxaQ-py3.10/lib/python3.10/site-packages/starlite/handlers/http.py", line 493, in resolve_response_handlerif isclass(self.signature.return_annotation) andissubclass(
File "/home/peter/.pyenv/versions/3.10.5/lib/python3.10/abc.py", line 123, in __subclasscheck__return _abc_subclasscheck(cls, subclass)
TypeError: issubclass() arg 1 must be a class
I think it is any route that returns a collection as the current app I'm working on runs if I remove any routes returning collections such as:
@lib.get_collection()asyncdeflist_providers(self, service: providers.Service) ->list[providers.Schema]:
"""A paginated list of all registered providers"""returnawaitservice.list()
The text was updated successfully, but these errors were encountered:
I guess the reason that this wasn't picked up in tests is because we always use the generic collection types imported from typing in our tests for backwards compatibility. We probably need to add some tests that only run on 3.9+ that use the generic builtin types.
I think it is any route that returns a collection as the current app I'm working on runs if I remove any routes returning collections such as:
The text was updated successfully, but these errors were encountered: