Skip to content

Add option to include a lock file for frozen dependencies #11

Description

@ubalklen

Summary

Add a CLI option (e.g. -l / --lock-file) to include a lock file (such as uv.lock) in the generated distribution, allowing users to freeze exact dependency versions.

Motivation

Currently, dependencies are resolved at install time on the target machine via requirements.txt or pyproject.toml. This means the installed versions may differ from what was tested by the script author. Including a lock file ensures reproducible installs with exact pinned versions.

Proposed behavior

  • Add a new option -l / --lock-file similar to the existing -t / --pyproject-file option.
  • When provided, the specified lock file is copied to the root of the distribution alongside the pyproject.toml.
  • The generated batch file should pass the lock file to uv so it uses locked versions during install (e.g. uv run --locked).
  • If no explicit path is given, the tool could optionally look for a uv.lock in the script's directory (mirroring how pyproject.toml is auto-discovered).
  • Should validate that a pyproject.toml is also present when a lock file is used, since lock files depend on it.

Example usage

frigobar my_script.py dist -t pyproject.toml -l uv.lock

Implementation notes

  • CLI: add the argument in cli.py, pass it through to create_frigobar().
  • Core: in frigobar.py, copy the lock file to the distribution root and adjust the BATCH_TEMPLATE to use --locked when a lock file is present.
  • Follow the same pattern as -t / --pyproject-file for validation and file handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions