Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible bug with Workspace.lock_path initialization #6142

Closed
idlsoft opened this issue Aug 16, 2024 · 2 comments · Fixed by #6157
Closed

Possible bug with Workspace.lock_path initialization #6142

idlsoft opened this issue Aug 16, 2024 · 2 comments · Fixed by #6157
Assignees

Comments

@idlsoft
Copy link
Contributor

idlsoft commented Aug 16, 2024

A recent change added this line to uv-resolver/src/lock.rs:

let lock_path = relative_to(workspace.lock_path(), &lock_path).unwrap();

This line panicks if workspace.lock_path is initialized from Path::new("").to_path_buf(), which does happen here

        Self::from_project(
            project_root,
            Path::new(""),
            &project,
            &pyproject_toml,
            options,
        )

and here.

            let project = ProjectWorkspace::from_project(
                project_root,
                Path::new(""),
                project,
                &pyproject_toml,
                options,
            )

I'm not sure if this ever actually triggers in the existing codebase, but it seems inconsistent, probably worth a look?

@charliermarsh
Copy link
Member

I can double-check, thanks.

@charliermarsh charliermarsh self-assigned this Aug 16, 2024
@idlsoft
Copy link
Contributor Author

idlsoft commented Aug 16, 2024

FWIW replacing Path::new("") with project_root takes care of it and doesn't break any existing unit tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants