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

Upgrade vesion of fastapi to 0.103.1 #21167

Merged
merged 1 commit into from Nov 2, 2023

Conversation

cquike
Copy link
Contributor

@cquike cquike commented Oct 31, 2023

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)
  • bugfix
Tested on

macOS 13.3.1 22E261 arm64

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL?
  • checked your Portfile with port lint --nitpick?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@herbygillot
Copy link
Member

herbygillot commented Oct 31, 2023

Thank you for this submission, @cquike. Two things:

  1. The commit message should be of the format, <port name>: <description>. So instead of Upgrade vesion of fastapi to 0.103.1, it should be py-fastapi: update to 0.103.1.
  2. You can reference the Trac issue in the commit message. You can add Closes: https://trac.macports.org/ticket/54100 as a second line to the commit message, after making the change above, and the Trac issue will be closed when this is merged.

Please amend and force push this branch to replace the commit with your new one incorporating the above changes.

@pmetzger
Copy link
Member

pmetzger commented Nov 1, 2023

I edited the original request to fix [X ] and [ X] into [X] so the system would register them correctly.

@cquike
Copy link
Contributor Author

cquike commented Nov 2, 2023

I have amended the commit and pushed the changes.
Thank you for the review!

@herbygillot herbygillot merged commit 804a2e1 into macports:master Nov 2, 2023
3 checks passed
@herbygillot
Copy link
Member

Merged, @cquike. Thank you for this submission.

@herbygillot
Copy link
Member

The Trac issue did get closed on merge, but @cquike, I think you linked to the wrong issue. Trac issue 54100 is referencing get_iplayer, and not py-fastapi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants