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 Python 3.8 & 3.12 in CI builds #163

Merged
merged 9 commits into from
Feb 7, 2024
Merged

Use Python 3.8 & 3.12 in CI builds #163

merged 9 commits into from
Feb 7, 2024

Conversation

scy
Copy link
Collaborator

@scy scy commented Oct 3, 2023

Oldest and most recent supported versions.

@scy scy added type:enhancement New feature or request area:backend Related to the server component labels Oct 3, 2023
@scy scy added this to the 4.0: public release milestone Oct 3, 2023
@scy scy self-assigned this Oct 3, 2023
@scy
Copy link
Collaborator Author

scy commented Oct 3, 2023

uvloop currently does not support 3.12 yet: MagicStack/uvloop#567

I’ve subscribed to that issue and will update this PR once there’s been a release.

@jbethune jbethune added the state:postponed Deemed low priority label Oct 3, 2023
@scy scy added the prio:D Completely optional, but interesting nevertheless label Oct 11, 2023
@scy
Copy link
Collaborator Author

scy commented Oct 15, 2023

Okay, now the issue is that httptools doesn’t have a wheel available for Python 3.12, and building it from source fails.

I guess we’ll wait for MagicStack/httptools#94 to be resolved.

We’re pulling httptools as part of uvicorn[standard]. Uvicorn would run without it, but I’d rather not specify its [standard] dependencies (sans httptools) by hand.

@scy
Copy link
Collaborator Author

scy commented Oct 16, 2023

Okay, now we’re blocked by flake8-quotes. Python 3.12 allows expressions in f-strings to use the same quotes as the f-string itself, e.g.

x = f"{foo["bar"]}"

However, Python < 3.12 doesn’t. Now, flake8-quotes complains that we’re using single quotes inside of our f-strings, but we have to to maintain backwards compatibility.

I won’t disable that check (Q000) because it applies both to quotes outside and inside of f-strings, so we’ll lose most of our quote checking. On the other hand, flake8-quotes seems not exactly well maintained. There’s no maintainer activity in the respective issue.

Maybe we’ll just have to move to black.

scy added 5 commits February 7, 2024 12:21
Oldest and most recent supported versions.
In preparation for Ruff not supporting setup.cfg.
This now throws 1426 errors :) Setting up some ignore rules next.
It's only reporting errors for now, I'll make it mandatory after having
fixed or ignore a lot of errors :)
scy added 4 commits February 7, 2024 14:38
Also output in GitHub's format, this may give us inline annotations or
something.
Should fix `type 'typing.TypeVar' is not an acceptable base type`.
This _might_ fix the `TypeError: issubclass() arg 1 must be a class`
error that we're now getting on 3.8, which is, according to The
Internet™, related to upgrading typing-extensions.
@scy
Copy link
Collaborator Author

scy commented Feb 7, 2024

Since flake8-quotes still isn't ready for 3.12 due to lacking a maintainer, I've removed flake8 completely and instead went for Ruff, which is better in the long run anyway.

Ruff is obviously throwing lots of errors for our existing codebase now, which is why I've set it to only report errors, but not cause the build (or test.sh) to fail. I'll address these errors (either fixing them, or adding ignore rules) in a follow-up PR.

@scy scy removed the state:postponed Deemed low priority label Feb 7, 2024
@scy scy merged commit f4ac1f6 into main Feb 7, 2024
5 checks passed
@scy scy deleted the python-3.12 branch February 7, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:backend Related to the server component prio:D Completely optional, but interesting nevertheless type:enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants