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

Optionally present local dependencies and workspaces #1156

Open
nixjdm opened this issue Jun 12, 2024 · 0 comments
Open

Optionally present local dependencies and workspaces #1156

nixjdm opened this issue Jun 12, 2024 · 0 comments

Comments

@nixjdm
Copy link

nixjdm commented Jun 12, 2024

I'm curious how common my use-case / desire is here. I suspect this is uncommon, but not exceedingly rare.

I have a project that has several dependencies I would like to install locally so that I can develop the main project and those dependencies. The trouble is that those dependencies already have homes which shouldn't/can't change, and shouldn't be vendored into the main project's repository. The main project should be easy to use, and generally run well with the dependencies coming from their normal source (e.g. pypi), and this would be the common use of the main project.

Currently, as a workaround, I clone the dependencies, comment out the line in the pyproject.toml that referenced them, and rye add dep --path ../dep --absolute (relative paths seem to have other issues currently). I don't have a solution that doesn't involve making a change to the pyproject.toml, or a resultant change to a lock file. This workaround keeps things easy for most users, but is a bit of a pain for some developers like me.

A solution might look like a pyproject.toml including a dependency in dependencies and define a workspace that may be empty, or have that dependency present in the workspace. If found in the workspace, that version could be used instead of the one in the dependencies array.

Another would be to allow a local source to be defined. I don't think that's possible now. Something like

[[tool.rye.sources]]
name = "local"
path = ".."
type = "path"  # seems redundant given the absence of `url` and presence of `path`

Or another, to allow a variant dependency syntax to specify that an installation path should fall back to a typical installation. I'm not sure the best way to indicate a fallback to dep @ file:///path/dep"

If there are other suggestions for how to handle the general situation now, I'd love to hear them. Thanks!

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

No branches or pull requests

1 participant