Skip to content

feat: Evaluate Python dependency source precedence #4476

Open

Description

@bschwedler

I’d prefer a lockfile or pyproject.toml over requirements.txt, which can be a stale export. Currently, an existing requirements file always wins.

✓ = present; — = absent. Default configuration, valid dependency sources, and no pylock.toml.

requirements.txt pyproject.toml uv.lock Selected source
— — — Import scan¹
✓ — — Requirements
— ✓ — Pyproject
— — ✓ uv lock
✓ ✓ — Requirements
✓ — ✓ Requirements
— ✓ ✓ uv lock
✓ ✓ ✓ Requirements

pylock.toml takes precedence over uv and pyproject, but not requirements.

¹ Automatic scanning is under Unreleased in the inspected changelog. It writes requirements.txt, which then wins on later deployments.

Could we reconsider this order and let users explicitly select deployment-specific requirements?

Related issues

Activity

  1. karawoo commented on Nov 13, 2026

    @karawoo
    Contributor

    I think this makes sense and ideally we'd have consistent behavior with rsconnect-python. I see you filed an issue there as well.

    Seems like a good first step would be to allow package_file to accept uv.lock, pylock.toml, and pyproject.toml (which rsconnect-python already allows with -r). Changing the default precedence order seems feasible too; projects that already have package_file = "requirements.txt" could continue using that so they don't get unexpected results during their next deploy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions