Open drawnwren opened 2 months ago
What worked for me was using the submodule as a flake input:
inputs = {
my-library = {
url = "git+file:my-library-dir";
flake = false;
};
}
Then setting editablePackageSources to point to it:
outputs = { self, ..., my-library }: {
# ...
devShell = mkPoetryEnv {
editablePackageSources = {
my-library = my-library;
};
};
And keep pyproject.toml
as if importing the library from pip. No need to set path
and develop = true
The downside is I have to run nix flake lock --update-input my-library
every time I make a change.
But with how flakes are coupled to the git state, I don't think it'd be possible to import the library without flattening it into the parent's/monorepo git tree. As in, I don't think it's possible for flakes to link to submodules dynamically, as everything is locked by flake.lock.
I have a monorepo structured like so:
Where
a
importsb
as editable withb = {path="../b", develop=true}
in thepyproject.toml
. I'm having trouble getting my nix development derivation to importb
correctly into the shell.I've tried:
a/flake.nix
with a derivation like: