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

Use new features from Python 3.12 throughout API code #566

Open
7 tasks
taesungh opened this issue Jan 16, 2025 · 0 comments
Open
7 tasks

Use new features from Python 3.12 throughout API code #566

taesungh opened this issue Jan 16, 2025 · 0 comments

Comments

@taesungh
Copy link
Member

taesungh commented Jan 16, 2025

Following from #388/#565, the serverless function for the API is now deployed with Python 3.12. Accordingly, there are a few new language features we could be using along with other things to update. These should ideally happen in phases rather than all at once.

General

  • Update checks workflow and Dockerfile to use Python 3.12
  • Check if overriding AsyncIOMotorClient.get_io_loop (mongodb_handler.py:23) is still necessary

New in Python 3.10

  • Use new type union operator (e.g. X | Y) instead of typing.Union
  • Import TypeAlias from typing rather than typing_extensions

New in Python 3.11

  • Use the native enum.StrEnum
    • Be careful to check there are no regressions (e.g. might need .value in some places or no longer need in others)
  • Import assert_never from typing rather than typing_extensions

New in Python 3.12

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

No branches or pull requests

1 participant