fix: update pre-commit CI to use python 3.12#676
Conversation
4d43d6d to
40322bd
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the syntax-check workflow to run pre-commit with Python 3.12 and includes formatting changes produced under that interpreter. Several changes introduce Python 3.12-only multiline f-string syntax while the package still declares Python >=3.10 support.
Changes:
- Updates
.github/workflows/checks.ymlfrom Python 3.10 to 3.12. - Reformats f-string expressions and arithmetic spacing across package, example, and test files.
- Touches assertion/log/error message formatting without intended behavioral changes.
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/checks.yml |
Updates pre-commit CI Python version to 3.12. |
aperturedb/CommonLibrary.py |
Reformats configuration assertion messages. |
aperturedb/CSVWriter.py |
Reformats CSV conversion assertion messages. |
aperturedb/ParallelQuery.py |
Reformats query structure logging. |
aperturedb/ParallelQuerySet.py |
Reformats blob-count logging. |
aperturedb/Query.py |
Reformats time range string expressions. |
aperturedb/Utils.py |
Reformats schema visualization HTML strings and arithmetic spacing. |
aperturedb/cli/configure.py |
Reformats overwrite warning message. |
examples/CelebADataKaggle.py |
Reformats keypoint f-string construction. |
examples/loading_with_models/get_tl_embeddings.py |
Reformats embedding index display spacing. |
test/conftest.py |
Reformats expected-index assertion message. |
test/test_Datawizard.py |
Reformats arithmetic spacing in generated names. |
test/test_Server.py |
Reformats assertion message. |
test/test_Stats.py |
Reformats assertion message. |
Comments suppressed due to low confidence (9)
aperturedb/CommonLibrary.py:102
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert "name" in config, f"name is required in the configuration: {
clean_config}"
aperturedb/CSVWriter.py:71
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert source_column in df.columns, f"source_column {
source_column} not found in the input data"
aperturedb/CSVWriter.py:88
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert unique_key in df.columns, f"unique_key {
unique_key} not found in the input data"
aperturedb/CSVWriter.py:147
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert source_column in df.columns, f"source_column {
source_column} not found in the input data"
aperturedb/CSVWriter.py:152
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert destination_column in df.columns, f"destination_column {
destination_column} not found in the input data"
aperturedb/CSVWriter.py:161
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
assert unique_key in df.columns, f"unique_key {
unique_key} not found in the input data"
aperturedb/ParallelQuerySet.py:161
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
f"Set {i}: Expected {
expected_blobs} blobs, but filter is returning {blobs_this_set}"
aperturedb/Utils.py:195
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
table += f'<TR><TD BGCOLOR="{colors["connection_background"]}" COLSPAN="3" PORT="{connection}"><FONT COLOR="{
colors["connection_foreground"]}"><B>{connection}</B> ({matched:,})</FONT></TD></TR>'
aperturedb/Utils.py:199
- This multiline f-string expression requires Python 3.12 (PEP 701), but the project still declares support for Python >=3.10. Importing this module on Python 3.10/3.11 will fail with a SyntaxError.
table += f'<TR><TD BGCOLOR="{colors["connection_property_background"]}"><FONT COLOR="{colors["connection_property_foreground"]}"><B>{prop.strip()}</B></FONT></TD> <TD BGCOLOR="{colors["connection_property_background"]}"><FONT COLOR="{
colors["connection_property_foreground"]}">{matched:,}</FONT></TD> <TD BGCOLOR="{colors["connection_property_background"]}"><FONT COLOR="{colors["connection_property_foreground"]}">{"Indexed" if indexed else "Unindexed"}, {typ}</FONT></TD></TR>'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ad-claw000
left a comment
There was a problem hiding this comment.
Addressed all Copilot review comments and fixed the backwards compatibility for Python >=3.10 with autopep8's multiline f-strings.
ad-claw000
left a comment
There was a problem hiding this comment.
Fixed the remaining Python 3.10 syntax errors caused by PEP 701 multi-line f-strings generated by autopep8 when running under Python 3.12. The pre-commit syntax check is now completely green.
Description
This PR fixes the formatting inconsistencies between local development environments and the CI pipeline.
The Issue
The CI pipeline was running pre-commit hooks using Python 3.10. However, developers running pre-commit locally with Python 3.12+ were generating code with line breaks inside f-string expressions. (PEP 701, introduced in Python 3.12, allows line breaks inside f-string braces). When pushed, this caused CI formatting failures.
The Fix
Instead of forcing local environments to downgrade to Python 3.10, this PR updates the
syntax-checkworkflow in.github/workflows/checks.ymlto usepython-version: '3.12'. This aligns the CI with local 3.12+ environments.Closes no specific issue.