Skip to content

universal-lock: if we write file paths to a lock file, we need to make them portable #4307

@BurntSushi

Description

@BurntSushi

While working on #4266, I realized that the file paths we write to a lock file are platform specific. Specifically, on Windows, we use \ as a path separator, while on Unix, we use / as a path separator. I believe this implies that if developers on Windows and Unix work on the same project, they will generate different lock files. This is, I believe, untenable.

I think we either need to find a way to not write file paths to a lock file at all (this is what Cargo does), or we need to ensure we normalize all file paths into a portable representation.

It's not clear to me that the latter is strictly possible in all cases, but I think we are always writing Unix paths to requirements.txt by either converting \ to /, or using file URLs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    previewExperimental behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions