Upgrade vesion of fastapi to 0.103.1 #21167
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Hi, this PR tries to solve the issue that the fastapi python package is currently broken (https://trac.macports.org/ticket/54100). I created myself that ticket and I have now decided to see how it can be fixed.
The solution is to bump the version of fastapi to 0.103.1. It seems that fastapi is still not compatible with starlette 0.31.1 (tiangolo/fastapi#9939) although it seems that some compatibility is already done (tiangolo/fastapi#10194). This is not ideal, since it might be that some functionality of fastapi does not work properly, but at least it is better that the current situation in which it does not work at all.
This PR also changes the build system from flit to hatchling, that has happened in the meantime (tiangolo/fastapi#5240).
Additionally, it removed python37 support, since the starlette portfile does not support it anymore (https://github.com/macports/macports-ports/blob/master/python/py-starlette/Portfile)
The Portfile contain not tests, so I could not verify that, but I have tested it with an application that uses fastapi and things seems to be working fine, although admittedly such application does not exercise the full API of fastapi, of course.
Note that there is already a PR addressing something similar to this (#19950). However, in this PR I don't try to support python 3.11 for the time being, since that gives an error with pydantic. It also needs to patch pyproject.toml, to ensure that the version of starlette in the metadata is consistent with the version in macports. Also, it changes the build system dependency as mentioned to hatchling. Also the typing-extensions dependency was missing.
All in all, this PR tries to solve the immediate problem of the broken fastapi currently shipped, even if there are potentially some fixes to be done in the future (full support for starlette 0.31.1 and fix the errors in python 3.11).
Closes: https://trac.macports.org/ticket/54100
Type(s)
Tested on
macOS 13.3.1 22E261 arm64
Verification
Have you
port lint --nitpick
?sudo port test
?sudo port -vst install
?