Skip to content

Add support for installing CI-built sdist/wheel (prefer uv when artifact present) #2656

@anguzo

Description

@anguzo

Please allow Oryx Python builds to install from a user-provided distribution artifact (wheel or sdist) produced in CI, and prefer uv for installation when such an artifact is present. This preserves App Service’s non-container workflow while enabling modern pyproject-based pipelines and much faster, greener installs.

Since support for uv is coming (#2614, #2652) this should be easily achievable.

Why this is needed

  • Oryx today expects requirements.txt and does dependency resolution/build on the platform. Many teams now build wheels/sdists in CI via pyproject backends (Poetry/uv/PEP 517) for reproducibility and speed.
  • Installing a single artifact is deterministic, reduces network churn, and decouples resolution from the platform build.
  • uv brings substantial install-time savings for packages; e.g., msgraph-sdk local machine example: pip ~8 minutes vs uv ~20 seconds. At App Service scale, defaulting to uv for artifact installs would materially lower build time, CPU usage, and energy consumption.

What to add

  • Detection: If a single local distribution artifact exists (e.g., ./dist/*.whl or *.tar.gz)t, install it into the Oryx-managed venv.
  • Precedence:
    • If exactly one artifact is found under ./dist or project root, install it.
  • Installer preference:
    • Use uv to install the artifact by default (e.g., uv pip install ./my_app-1.0.0-py3-none-any.whl).
  • Optional flags to consider:
    • Allow pass-through of safe install flags via env vars (e.g., PYTHON_UV_INSTALL_ARGS), and to enable following best practices (e.g., use --compile-bytecode).

Example workflow

  • CI: uv build -> produces dist/app-1.0.0.whl (and/or sdist) -> include in the ZIP deployed to App Service.
  • Oryx: detects artifact; installs via uv by default; standard startup command (e.g., gunicorn ... my_app:app).

Benefits

  • Faster, greener builds: uv’s installer drastically reduces install time and CPU, improving latency and environmental impact.
  • Modern packaging compatibility: supports pyproject workflows without containerizing.
  • Reproducibility: dependency resolution and wheel building happen once in CI; Oryx installations are minimal and predictable.
  • Backwards compatible: if no artifact is present, behavior remains unchanged.

Scope and safety

  • Feature is opt-in via presence of an artifact.
  • Clear precedence rules avoid surprises; fall back to requirements.txt if ambiguity exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions