Hi all! I’m gearing up to start seriously working on a standard for expanding dependency specifiers to support relative paths.[1]
There a bunch of topics which need to be addressed. I’m looking for some initial reactions to the idea (anyone interested in sponsoring it?) and areas of concern which I might be missing.
Here’s my thought process so far, as a rough sketch…
Motivation
There are a number of project contexts in which you want to be able to refer to installation of the current project (implicitly a source tree, not a pre built wheel). Additionally, in monorepos multiple source trees may want to refer to one another.
A few workflow tools already have syntax for this (e.g., pdm), exemplifying the need.
Is there other stuff that’s worth thinking about as motivation? As far as I know, that’s about the long and short of it.
Editable Support
The most basic question is: should relative path dependencies support specifying editable installs?
Several tools support this, especially for the “current project”, so there’s some level of demand for this.
I’d be inclined to include it unless someone explains why it should not be supported.
Here’s a fun, but somewhat confusing idea about syntax: -e path/to/pkg
. As in, steal the -e
from CLI pip syntax and make it part of the dependency string. It has some interesting implications, like pip install "-e ."
being supported. I like how it would play out in dependent groups. Is this idea too wacky?
Publication of Packages with Relative Path Dependencies
Can you publish a package which depends on a relative path? What does that mean for installers?
I recall looking into the npm ecosystem support for relative paths, and they allow publication of such dependencies. I don’t remember seeing any special notes on installer behavior for npm.
I’d be inclined to allow this, but to explicitly allow installers to do what they like, including warning or erroring on such dependencies when installing. I think the only sensible non-error behavior is to resolve relative paths vis-a-vis the CWD or an explicitly specified directory.
Unix-style Paths
How naive am I being if I suggest that we use unix style paths and consider cross platform support a non-issue?
How much of the spec needs to be dedicated to spelling out this behavior?
Named Package @ Path
Is there significant benefit in requiring the package found at a path to be named, similar to what’s supported for URI dependencies?
For example, a syntax like foolib @ ./libs/foolib
.
This makes the package name available just from parsing, so it seems mildly advantageous. But I’m only seeing mild benefits to this, so unless someone can help explain why it would be worthwhile I’d be inclined not to require it.
So, yeah, very much interested in hearing some initial thoughts on this! Especially “you need to think about Topic X” which I could be missing.
Naturally, I was lying in wait so the lockfile discussion could get everyone’s full attention. Now I’m ready to monopolize all of your time again! Muahahahaha! ↩︎