Skip to content

fix: update pre-commit CI to use python 3.12#676

Merged
luisremis merged 9 commits into
developfrom
fix/python-version-pre-commit
May 18, 2026
Merged

fix: update pre-commit CI to use python 3.12#676
luisremis merged 9 commits into
developfrom
fix/python-version-pre-commit

Conversation

@ad-claw000
Copy link
Copy Markdown
Contributor

@ad-claw000 ad-claw000 commented May 14, 2026

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-check workflow in .github/workflows/checks.yml to use python-version: '3.12'. This aligns the CI with local 3.12+ environments.

Closes no specific issue.

@ad-claw000 ad-claw000 self-assigned this May 14, 2026
@ad-claw000 ad-claw000 force-pushed the fix/python-version-pre-commit branch from 4d43d6d to 40322bd Compare May 14, 2026 16:13
@ad-claw000 ad-claw000 changed the title fix: enforce python 3.10 for pre-commit formatting hooks fix: update pre-commit CI to use python 3.12 May 14, 2026
@luisremis luisremis requested a review from Copilot May 14, 2026 16:28
luisremis
luisremis previously approved these changes May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.yml from 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.

Comment thread .github/workflows/checks.yml
Comment thread aperturedb/CommonLibrary.py Outdated
Comment thread aperturedb/CSVWriter.py Outdated
Comment thread aperturedb/ParallelQuery.py Outdated
Comment thread aperturedb/ParallelQuerySet.py Outdated
Comment thread examples/CelebADataKaggle.py Outdated
Comment thread test/conftest.py Outdated
Comment thread test/test_Server.py Outdated
Comment thread test/test_Stats.py Outdated
Comment thread aperturedb/Query.py Outdated
Copy link
Copy Markdown
Contributor Author

@ad-claw000 ad-claw000 left a comment

Choose a reason for hiding this comment

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

Addressed all Copilot review comments and fixed the backwards compatibility for Python >=3.10 with autopep8's multiline f-strings.

Copy link
Copy Markdown
Contributor Author

@ad-claw000 ad-claw000 left a comment

Choose a reason for hiding this comment

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

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.

luisremis
luisremis previously approved these changes May 18, 2026
@luisremis luisremis merged commit b8a2939 into develop May 18, 2026
3 checks passed
@luisremis luisremis deleted the fix/python-version-pre-commit branch May 18, 2026 23:57
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.

3 participants