Skip to content

[bug] Pre-commit fails due to yapf dependency on lib2to3 in Python 3.12+ #12393

@HarshitR2004

Description

@HarshitR2004

Environment

  • How do you deploy Kubeflow Pipelines (KFP)?

Local development / pre-commit hooks (Python environment)

  • KFP version: N/A (pre-commit hook issue, not runtime)
  • KFP SDK version: N/A (pre-commit hook issue, not SDK-specific)

Steps to reproduce

Use Python 3.12+.

Install the repository’s pre-commit hooks:

pre-commit install

Try to commit code:

git commit -m "test commit"

Observe the error:

ModuleNotFoundError: No module named 'lib2to3'

Expected result

Pre-commit hooks should run successfully regardless of Python 3.12+.
yapf formatting should complete without errors.

Suggested workaround: downgrade Python (<3.12) or migrate from yapf → ruff.

Labels


Impacted by this bug? Give it a 👍.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions