Skip to content

Allow cross-platform consistency in local file paths for pylock.toml exports #16514

@ncoghlan

Description

@ncoghlan

Summary

When exporting to pylock.toml, uv currently emits absolute file URLs on all platforms. The "URLs" emitted on windows dump in the raw Windows path, including the use of backslash separators instead of forward slash ones.

This is inconvenient when the local files should be located relative to the lock file (e.g. when they're stored in Git LFS).

Proposed changes:

  • always use POSIX path separators in pylock.toml, even on Windows
  • emit relative path entries rather than absolute url entries where possible
  • emit absolute path entries on Windows if the files referenced are on a different drive from the lock file export location

There could potentially be a config flag to force the use of absolute paths (that may still be useful for some use cases where the files are in known locations on target systems of interest, but the location of the lock file itself at installation time isn't the same as it's location when being exported)

Example

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions