Skip to content

Codegen prek hooks fail with uv 0.12 #71377

Description

@rino0601

Under which category would you file this issue?

Task SDK

Apache Airflow version

main (development checkout)

What happened and how to reproduce it?

Issue description

The Task SDK and AirflowCTL datamodel-generation prek hooks pass distribution names to uv run --project. uv expects --project to identify an existing project directory or pyproject.toml, not a distribution name.

Both hook entries already use --directory with the actual project directory, so the invalid --project option is unnecessary:

  • generate-tasksdk-datamodels: --project apache-airflow-task-sdk --directory task-sdk
  • generate-airflowctl-datamodels: --project apache-airflow-ctl --directory airflow-ctl

uv 0.12 rejects the missing directories before either generator runs.

Steps to reproduce

  1. Use a checkout containing the current .pre-commit-config.yaml entries, with uv 0.12.3 and prek 0.4.13.

  2. Run:

    $ prek run generate-tasksdk-datamodels --all-files
    Generate Datamodels for TaskSDK client...................................Failed
    - hook id: generate-tasksdk-datamodels
    - exit code: 2
    
      error: Project directory `apache-airflow-task-sdk` does not exist
  3. Run:

    $ prek run generate-airflowctl-datamodels --all-files
    Generate Datamodels for AirflowCTL.......................................Failed
    - hook id: generate-airflowctl-datamodels
    - exit code: 2
    
      error: Project directory `apache-airflow-ctl` does not exist

uv 0.11.29 emits a warning and continues, which masks the invalid arguments:

warning: Project directory `apache-airflow-task-sdk` does not exist.
This will become an error in a future release.

It is therefore not a durable workaround. In addition, the 0.11 execution refreshed uv.lock even though generated Task SDK model output did not change.

What you think should happen instead?

Both codegen hooks should run successfully with uv 0.12+ when their generated output is current.

Remove the invalid --project apache-airflow-task-sdk and --project apache-airflow-ctl arguments while retaining the existing --directory task-sdk and --directory airflow-ctl options. The corresponding command examples in task-sdk/pyproject.toml and airflow-ctl/pyproject.toml should be corrected in the same change.

Operating System

Ubuntu 24.04.1 LTS (WSL)

Deployment

Other — local development checkout using prek

Apache Airflow Provider(s)

Not applicable

Versions of Apache Airflow Providers

Not applicable

Official Helm Chart version

Not Applicable

Kubernetes Version

Not Applicable

Helm Chart configuration

Not Applicable

Docker Image customizations

Not Applicable

Anything else?

The code generators themselves run successfully through Breeze when invoked with the actual project directories. This is a local-development hook configuration issue, not an API model-generation failure.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct


Drafted-by: Codex (GPT-5) (no human review before posting)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dev-envCI, pre-commit, pylint and other changes that do not change the behavior of the final codekind:bugThis is a clearly a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions