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

Installing from subdirectories is broken in 0.1.26 (and 0.1.25 probably) #2727

Closed
abdulhaq-e opened this issue Mar 30, 2024 · 5 comments · Fixed by #2728
Closed

Installing from subdirectories is broken in 0.1.26 (and 0.1.25 probably) #2727

abdulhaq-e opened this issue Mar 30, 2024 · 5 comments · Fixed by #2728
Assignees
Labels
bug Something isn't working

Comments

@abdulhaq-e
Copy link

A dependency defined using a subdirectory fails to generate the lockfile in 0.1.26.

An example dependency is: "mersal @ git+ssh://git@github.com/mersal-org/mersal.git@trunk#subdirectory=core"

The error message is:

error: Failed to download and build: mersal @ git+ssh://git@github.com/mersal-org/mersal.git@trunk#subdirectory=core
  Caused by: Package metadata name `mersal-virtual-workspace` does not match given name `mersal`
error: could not write production lockfile for project

The error was originally obtained using rye sync but then I switched to using uv directly via uv pip compile pyproject.toml -o requirements.txt

What is happening: The process is finding a pyproject.toml at the root directory which has a package metadata name mersal-virtual-workspace. This didn't happen in version 0.1.24 or before (I tested from 01.20).

With 0.1.25, I get a different error which I believe is now resolved in 0.1.26 (#2712):

 Caused by: Failed to deserialize cache entry
  Caused by: expected version to start with a number, but no leading ASCII digits were found

However, looking at the changelog, the original error was probably caused by a change in 0.1.25.

@abdulhaq-e
Copy link
Author

If I had to guess, it's probably not the subdirectory handling itself being broken but the existence of a pyproject.toml in the root directory is throwing the resolver.

@abdulhaq-e abdulhaq-e changed the title Subdirectories are broken in 0.1.26 (and 0.1.25 probably) Installing from subdirectories is broken in 0.1.26 (and 0.1.25 probably) Mar 30, 2024
@zanieb
Copy link
Member

zanieb commented Mar 30, 2024

Thanks for the thorough report! If you have time, could you share a reproduction with a public repository?

Note for us, we should add test coverage for this in a new astral-test repository (e.g. uv-pypackage-workspace).

cc @charliermarsh

@zanieb zanieb added the bug Something isn't working label Mar 30, 2024
@charliermarsh
Copy link
Member

Not immediately obvious to me how this would be happening.

@charliermarsh
Copy link
Member

Sorry, yes it is. Easy fix, my mistake.

@charliermarsh charliermarsh self-assigned this Mar 30, 2024
charliermarsh added a commit that referenced this issue Mar 30, 2024
## Summary

This was just an oversight (and a lack of test coverage).

Closes #2727.
@charliermarsh
Copy link
Member

Fixed in the next release, apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants