mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-06 09:41:39 -05:00
fix: patch nbconvert
installed source when installed from wheel
This commit is contained in:
parent
cefd25bc6a
commit
d72e0b4c0f
1 changed files with 21 additions and 13 deletions
|
@ -2732,29 +2732,37 @@ lib.composeManyExtensions [
|
|||
buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ];
|
||||
});
|
||||
|
||||
nbconvert = super.nbconvert.overridePythonAttrs (old: {
|
||||
postPatch = lib.optionalString (!old.src.isWheel) (
|
||||
lib.optionalString (lib.versionAtLeast self.nbconvert.version "6.5.0") ''
|
||||
nbconvert =
|
||||
let
|
||||
patchExporters = lib.optionalString (lib.versionAtLeast self.nbconvert.version "6.5.0") ''
|
||||
substituteInPlace \
|
||||
./nbconvert/exporters/templateexporter.py \
|
||||
--replace \
|
||||
'root_dirs.extend(jupyter_path())' \
|
||||
'root_dirs.extend(jupyter_path() + [os.path.join("@out@", "share", "jupyter")])' \
|
||||
--subst-var out
|
||||
'' + lib.optionalString (lib.versionAtLeast self.nbconvert.version "7.0") ''
|
||||
substituteInPlace \
|
||||
./hatch_build.py \
|
||||
--replace \
|
||||
'if self.target_name not in ["wheel", "sdist"]:' \
|
||||
'if True:'
|
||||
''
|
||||
);
|
||||
});
|
||||
'';
|
||||
in
|
||||
super.nbconvert.overridePythonAttrs (old: {
|
||||
postPatch = lib.optionalString (!old.src.isWheel) (
|
||||
patchExporters + lib.optionalString (lib.versionAtLeast self.nbconvert.version "7.0") ''
|
||||
substituteInPlace \
|
||||
./hatch_build.py \
|
||||
--replace \
|
||||
'if self.target_name not in ["wheel", "sdist"]:' \
|
||||
'if True:'
|
||||
''
|
||||
);
|
||||
postInstall = lib.optionalString old.src.isWheel ''
|
||||
pushd $out/${self.python.sitePackages}
|
||||
${patchExporters}
|
||||
popd
|
||||
'';
|
||||
});
|
||||
|
||||
mkdocs = super.mkdocs.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.babel ];
|
||||
});
|
||||
}
|
||||
)
|
||||
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue