Skip to content

Python3.13 compatibility #63

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

Merged
merged 5 commits into from
Jun 7, 2025
Merged

Conversation

OlegZv
Copy link
Collaborator

@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
Collaborator Author

OlegZv commented Jan 6, 2025

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

@OlegZv
Copy link
Collaborator Author

OlegZv commented Feb 8, 2025

Hi @alexschimpf! Following up, any updates? Also, I don't think I can help with the pypi token and deployment, but if you can think of a way, I'm all ears!

@Wesztman
Copy link

Wesztman commented Apr 7, 2025

@alexschimpf, what is the status on this? :)

EDIT: @ofipify , tagging you since I saw you in the commit history :) this would be nice to merge (Y)

@andrewthetechie
Copy link

Also bumping here because I ran into this error as well and was working on a similar fix. Any chance we can get this merged and a new version cut?

@OlegZv
Copy link
Collaborator Author

OlegZv commented May 2, 2025

Just another attempt @alexschimpf :) Please merge the PR and cut a new version.

@OlegZv OlegZv self-assigned this May 20, 2025
@OlegZv
Copy link
Collaborator Author

OlegZv commented May 20, 2025

Just a quick update. This will be merged soon, and the new version should be out in about 2 weeks.

alexschimpf
alexschimpf previously approved these changes Jun 4, 2025
@OlegZv OlegZv force-pushed the python313_support branch from 429ac94 to d47ab6c Compare June 6, 2025 02:26
@OlegZv OlegZv requested a review from alexschimpf June 6, 2025 02:26
@OlegZv OlegZv merged commit 3025a3a into alexschimpf:main Jun 7, 2025
20 checks passed
@ofipify
Copy link
Contributor

ofipify commented Jun 9, 2025

Thank you. Much appreciated.

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.

5 participants