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

Python3.13 compatibility #63

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

OlegZv
Copy link

@OlegZv OlegZv commented Dec 18, 2024

Description

Tried using the package with python3.13 and hit this issue:
KeyError: "response_field'. Did you mean 'response_model"

I believe it's because python3.13 is trying to be more helpful in the error message when it hits a TypeError:
Example: "APIRouter.add_api_route() got an unexpected keyword argument 'response_field'. Did you mean 'response_model'?"

The current parsing fails because it extracts "response_field'. Did you mean 'response_model" from this error.

Using split approach is compatible with all versions.

The tests pass here: https://github.com/OlegZv/fastapi-versionizer/actions/runs/12386557668

Changes

  • updated the TypeError handling in _add_rout_to_router to extract the argument using string .split method.
  • added python 3.12 and 3.13 to the strategy matrix.
  • updated the actions/setup-python action version to v5.3.0.
  • updated some dev dependencies.

(@alexschimpf tagging you because I cannot assign you for review :) )

@OlegZv OlegZv changed the title Python313 support Python3.13 compatibility Dec 18, 2024
Copy link
Owner

@alexschimpf alexschimpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I think I need to update my PyPI token before I can deploy. It's been awhile since I've done it. I'll keep ya posted. Might be able to get to it this weekend.

@OlegZv
Copy link
Author

OlegZv commented Jan 6, 2025

Hey @alexschimpf! Happy New Year! Did you get a chance to update the pypi token for the deployment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants