Opened 7 months ago

Last modified 6 months ago

#68601 new defect

py310-fastapi package does work with available starlette version

Reported by: cquike Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-fastapi

Description

Hi, I have tried to use the py310-fastapi package but it seems that the installation now in macports is kind of broken as shown from this snippet:

# sudo install py310-fastapi
...
$ python3.10
Python 3.10.13 (main, Aug 25 2023, 02:38:26) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from fastapi import FastAPI
>>> app = FastAPI(title="myapp")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastapi/applications.py", line 145, in __init__
    self.middleware_stack: ASGIApp = self.build_middleware_stack()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/fastapi/applications.py", line 151, in build_middleware_stack
    debug = self.debug
AttributeError: 'FastAPI' object has no attribute 'debug'. Did you mean: '_debug'?

I believe the problem lies in the py310-starlette package, which is in version 0.31.0 which seems to be incompatible with the rather old fastapi 0.78.0 version.

Change History (3)

comment:1 Changed 7 months ago by cquike

I have bitten the bullet and tried to create a PR that fixes this: https://github.com/macports/macports-ports/pull/21167. More info in the PR.

comment:2 Changed 7 months ago by reneeotten (Renee Otten)

Keywords: fastapi removed
Priority: HighNormal

comment:3 Changed 6 months ago by cquike

This can be closed since a PR https://github.com/macports/macports-ports/pull/21167 has already been merged.

Note: See TracTickets for help on using tickets.