Skip to content

Conversation

kinuax
Copy link
Contributor

@kinuax kinuax commented May 15, 2024

CPython and click already dropped support for Python 3.7. I would propose to proceed accordingly here in order to benefit from:

  • reducing the CI tests
  • utilizing improved types without branching
  • making available the syntax provided by 3.8:
    • assignment expressions
    • positional-only arguments
    • f-strings with =

3.7 occurrences are updated. Literal related branching is cleaned. _typing is updated and simplified. All local tests pass on 3.8-3.12 and Linux.

Context: #828

This comment was marked as outdated.

@kinuax kinuax force-pushed the drop-support-for-python-3.7 branch from 18178cf to 314f504 Compare May 15, 2024 09:59

This comment was marked as outdated.

@kinuax kinuax force-pushed the drop-support-for-python-3.7 branch from 2e8fcdd to caf601e Compare May 15, 2024 10:04

This comment was marked as outdated.

@kinuax
Copy link
Contributor Author

kinuax commented May 15, 2024

CI tests pass.

@svlandeg svlandeg added feature New feature, enhancement or request breaking p3 labels May 17, 2024
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

Thanks for the very thorough PR!

I'll have to ask @tiangolo what the term is he wants to drop Python 3.7 by.

Note - I'm also maintaining spaCy and there we just bumped the Typer pin to allow any v0.x. If Typer drops Python 3.7 which spaCy v3 still supports, we'll have to again restrict the upper bound for Typer there. And I can imagine spaCy not being the only repo that would run into this.

I think we'll want to drop 3.7 at some point, it's just a question of when :-)

This comment was marked as outdated.

@kinuax
Copy link
Contributor Author

kinuax commented May 17, 2024

@svlandeg, thanks for reviewing the PR and for sharing your thoughts. 👍

I understand the concern about avoiding breaking dependent libraries.

Besides, I rechecked the click repo and I would like to inform (and also correct previous statements) that, although old, the specific change that drops 3.7 is not released yet (it was merged in main branch right after the latest release 8.1.7).
This means that, in my opinion, the consideration of dropping support in Typer would happen, at least, after a new click release takes place. So this PR is just a prep for that moment.

@tiangolo
Copy link
Member

Thanks @kinuax! I want to keep support for Python 3.7 for a while. It's currently not being a problem (yet) so I prefer to delay this a bit.

I would also want to have some features and fixes in before dropping support, so that people stuck in 3.7 can benefit from them too.

This comment was marked as outdated.

@kinuax
Copy link
Contributor Author

kinuax commented May 20, 2024

@tiangolo, all right, I understand, thanks for clarifying.

This comment was marked as outdated.

@svlandeg svlandeg removed feature New feature, enhancement or request breaking labels Sep 3, 2024
@svlandeg svlandeg added breaking and removed upgrade labels Sep 3, 2024

This comment was marked as outdated.

This comment was marked as outdated.

@kinuax
Copy link
Contributor Author

kinuax commented Jan 10, 2025

Merge conflicts are solved and tests are passing. Ready to be reviewed.

This comment was marked as outdated.

This comment was marked as outdated.

@kinuax
Copy link
Contributor Author

kinuax commented Apr 14, 2025

Latest merge conflicts are solved.

@kinuax
Copy link
Contributor Author

kinuax commented May 13, 2025

Recent Click release 8.2.0 drops support for Python 3.7.

@svlandeg svlandeg self-assigned this Aug 28, 2025
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

All our other repos (asyncer, fastapi, sqlmodel) have now also dropped support for Python 3.7, as has Click. So I think we should go ahead and merge this to avoid issues on other PRs.

@kinuax: thanks for your continued work on this! Much appreciated 🙏

@svlandeg svlandeg removed their assignment Aug 28, 2025
Copy link
Contributor

github-actions bot commented Sep 1, 2025

📝 Docs preview for commit f91947a at: https://1e602f84.typertiangolo.pages.dev

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

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

The time has come, let's do this! 🚀 🔥


I'm not marking it as a breaking change because package installers like pip and any others wouldn't accidentally install an unsupported version, so even if we make new releases with things unsupported in previous versions of Python, those won't be installed in those versions because the installer checks for Python version compatibility.

@tiangolo tiangolo merged commit 8e4e4cd into fastapi:master Sep 20, 2025
28 checks passed
@kinuax kinuax deleted the drop-support-for-python-3.7 branch September 22, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants