mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 16:51:40 -05:00
Remove "path" dependencies in indirectly referenced packages
This commit is contained in:
parent
b013b7a1c9
commit
71cdd20018
3 changed files with 15 additions and 8 deletions
|
@ -194,13 +194,7 @@ let
|
|||
python = py;
|
||||
};
|
||||
|
||||
postPatch = (passedAttrs.postPatch or "") + ''
|
||||
# Tell poetry not to resolve the path dependencies. Any version is
|
||||
# fine !
|
||||
yj -tj < pyproject.toml | ${python.interpreter} ${./pyproject-without-path.py} > pyproject.json
|
||||
yj -jt < pyproject.json > pyproject.toml
|
||||
rm pyproject.json
|
||||
'';
|
||||
postPatch = (passedAttrs.postPatch or "") + poetryLib.removeTOMLPathDependencies python;
|
||||
|
||||
meta = meta // {
|
||||
inherit (pyProject.tool.poetry) description homepage;
|
||||
|
|
9
lib.nix
9
lib.nix
|
@ -93,6 +93,14 @@ let
|
|||
[ pythonPackages.${drvAttr} or (throw "unsupported build system ${buildSystem}") ]
|
||||
);
|
||||
|
||||
removeTOMLPathDependencies = python: ''
|
||||
# Tell poetry not to resolve the path dependencies. Any version is
|
||||
# fine !
|
||||
${pkgs.yj}/bin/yj -tj < pyproject.toml | ${python.interpreter} ${./pyproject-without-path.py} > pyproject.json
|
||||
${pkgs.yj}/bin/yj -jt < pyproject.json > pyproject.toml
|
||||
rm pyproject.json
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
inherit
|
||||
|
@ -101,5 +109,6 @@ in
|
|||
isCompatible
|
||||
readTOML
|
||||
getBuildSystemPkgs
|
||||
removeTOMLPathDependencies
|
||||
;
|
||||
}
|
||||
|
|
|
@ -106,7 +106,9 @@ pythonPackages.callPackage (
|
|||
# Stripping pre-built wheels lead to `ELF load command address/offset not properly aligned`
|
||||
dontStrip = format == "wheel";
|
||||
|
||||
nativeBuildInputs = if (!isSource && (getManyLinuxDeps fileInfo.name).str != null) then [ autoPatchelfHook ] else [];
|
||||
nativeBuildInputs = (if (!isSource && (getManyLinuxDeps fileInfo.name).str != null) then [ autoPatchelfHook ] else [])
|
||||
++ lib.optional (isLocal) pkgs.yj;
|
||||
|
||||
buildInputs = (
|
||||
baseBuildInputs
|
||||
++ lib.optional (!isSource) (getManyLinuxDeps fileInfo.name).pkg
|
||||
|
@ -118,6 +120,8 @@ pythonPackages.callPackage (
|
|||
# but dependencies try to access Django
|
||||
builtins.map (n: pythonPackages.${lib.toLower n}) (builtins.attrNames dependencies);
|
||||
|
||||
postPatch = (args.postPatch or "") + lib.optionalString isLocal (poetryLib.removeTOMLPathDependencies python);
|
||||
|
||||
meta = {
|
||||
broken = ! isCompatible python.pythonVersion python-versions;
|
||||
license = [];
|
||||
|
|
Loading…
Add table
Reference in a new issue