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.
Summary
Add a CLI option (e.g.
-l/--lock-file) to include a lock file (such asuv.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.txtorpyproject.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
-l/--lock-filesimilar to the existing-t/--pyproject-fileoption.pyproject.toml.uvso it uses locked versions during install (e.g.uv run --locked).uv.lockin the script's directory (mirroring howpyproject.tomlis auto-discovered).pyproject.tomlis also present when a lock file is used, since lock files depend on it.Example usage
Implementation notes
cli.py, pass it through tocreate_frigobar().frigobar.py, copy the lock file to the distribution root and adjust theBATCH_TEMPLATEto use--lockedwhen a lock file is present.-t/--pyproject-filefor validation and file handling.