-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
Rye workspace possibly not handling repos where package name != repo name (!= module name)? #671
Comments
Rye current does not do anything to map url references to local workspaces. You currently cannot have a git based dependency thus be shadowed by one in the workspace. This is something I will need to address. Question is if it should always shadow? |
Assuming I'm understanding the case correctly, I very much like the current shadowing default (i.e. "When a package depends on another package it's first located in the workspace locally before it's attempted to be downloaded from an index"). It makes sense to me - you check out a package locally if you mean to make local modifications; it means that every package lives in the same virtualenv, which to me is the biggest advantage of the workspace feature (very appreciated by the way). If it didn't shadow, wouldn't that imply that two versions of the same package would have to be installed in the workspace virtualenv? I'm not sure how that would work, actually. I think separately I wasn't able to figure out why the Git invocation failed. This StackOverflow seems to indicate it's an issue with my |
In general |
Ah, I think I was assuming Poetry's specification is a standard. This spec seems to indicate that it's part of the spec to have a URL-based lookup (though the example doesn't mention SSH as a protocol, only HTTPS). So for anyone who runs into this in the future, before it's resolved, changing the above line in
(and installing Git Credentials Manager, which let me use HTTPS-based clones) seems to have fixed it. and actually... it seems to have worked exactly as I expected (i.e. shadowed by local install)? I see the following now:
And at least at first glance, it seems to work correctly (i.e. the modules are being imported from the local install, changes those files are immediately showing up in my virtualenv). I'm not sure it should have built those packages 3 times, but in this case it wasn't a big deal. It does seem to redo the build every time I add a new --dev dependency, which could hopefully be avoided. |
Maybe to make it more tractable to close this issue, maybe it's worth splitting up into smaller questions?
I understand this isn't the easiest decision to make because I know there's a lurking question about multi-version support (which is I guess how Cargo solves the related issue). From what I follow of Alex Crichton's response here, it sounds like Cargo chooses not to shadow; I think this is probably because every Cargo build is essentially "isolated". For my two cents, I think that behavior would be pretty confusing for anyone who is trying to get started with debugging / editing a library. Imagine writing your app to use Flask as a dependency, cloning Flask down to hack with something in the library to see how it works, and then when you run it, you don't see a change? I think it would be a lot clearer if it shadowed. |
Steps to Reproduce
I might be doing something wrong, so bear with me. I have an organization with 5 packages, let's call them
package_a
topackage_e
. For unfortunate historical reasons,package_e
has the following non-standard setup: the module name ispackage_e
, but the package is actually calledpackage_e-data
, and the repo name isPackage_e
(i.e. it's atgit.luolix.top/orgname/Package_e.git
. These are all private.I created a new directory,
orgname-meta
, and created apyproject.toml
with the following contents in it:package_a
has a dependency topackage_e
(the only one to do so) with the following line inproject.dependencies
:I cloned each of those packages into the
orgname-meta
folder, and ranrye sync
.Expected Result
rye sync
should complete, and the dependency inpackage_a
should be met via the completed local editable install ofpackage_e
.Actual Result
Do we know why rye is trying to download
Package_e.git
to satisfy the requirement forpackage_a
(I think that's what it's doing?). I would have kind of expected it to use the existingPackage_e
local install, but maybe it's getting confused?Version Info
Stacktrace
The text was updated successfully, but these errors were encountered: