-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Upstream overrides #1796
base: master
Are you sure you want to change the base?
Upstream overrides #1796
Changes from all commits
f9ee56b
c2a75a3
89d4c1c
709c5dc
3d2a620
9457c2c
ce2d9a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1023,11 +1023,12 @@ lib.composeManyExtensions [ | |
} | ||
)); | ||
|
||
gitpython = prev.gitpython.overridePythonAttrs ( | ||
old: { | ||
buildInputs = old.buildInputs or [ ] ++ [ final.typing-extensions ]; | ||
} | ||
); | ||
gitpython = prev.gitpython.overridePythonAttrs { | ||
postPatch = '' | ||
substituteInPlace git/cmd.py \ | ||
--replace 'git_exec_name = "git"' 'git_exec_name = "${pkgs.gitMinimal}/bin/git"' | ||
''; | ||
}; | ||
|
||
grpcio = prev.grpcio.overridePythonAttrs (old: { | ||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ]; | ||
|
@@ -1401,6 +1402,21 @@ lib.composeManyExtensions [ | |
''; | ||
}); | ||
|
||
libcst = prev.libcst.overridePythonAttrs ( | ||
old: lib.optionalAttrs (!(old.src.isWheel or false)) | ||
{ | ||
cargoDeps = pkgs.rustPlatform.importCargoLock { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is using IFD. Please use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you meant libcst = prev.libcst.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) (
let
unpackedSrc = stdenv.mkDerivation {
name = "unpacked-${old.src.name}";
inherit (old) src;
buildPhase = "cp -r . $out";
};
in
{
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = "${unpackedSrc.out}/native/Cargo.lock";
};
cargoRoot = "native";
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
pkgs.rustPlatform.cargoSetupHook # handles `importCargoLock`
pkgs.rustc
pkgs.cargo
];
}
)
); There are also multiple other places, where poetry2nix could automatically get dependencies, but instead you chose to manually add them to every package. E.g. if poetry or setuptools are required for build: https://github.com/py-mine/mcstatus/blob/0bbd4842178fa1db252371ce5599651e4b867efd/pyproject.toml#L164 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adisbladis can you elaborate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I learned about IFD since then and will try to fix the issue |
||
lockFile = ./libcst/${old.version}-Cargo.lock; | ||
}; | ||
cargoRoot = "native"; | ||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ | ||
pkgs.rustPlatform.cargoSetupHook # handles `importCargoLock` | ||
pkgs.rustc | ||
pkgs.cargo | ||
]; | ||
} | ||
); | ||
|
||
libvirt-python = prev.libvirt-python.overridePythonAttrs (old: { | ||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ]; | ||
propagatedBuildInputs = [ pkgs.libvirt ]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gitpython should not decide on it's own to pull in a specific git as a dependency imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How it will function then? It is a general approach to patch packages to provide their dependencies without propagating them. You can change git version used using an overlay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide the git binary in
PATH
or override the variable in your application codeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not expect
gitpython
thepython
package to installgit
for meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, this is how gitpython in nixpkgs is packaged:
https://github.com/NixOS/nixpkgs/blob/a8be94c0af330325c8c96730cdae5e168a0632a1/pkgs/development/python-modules/gitpython/default.nix#L34
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it was introduced 6 years ago in upstream: NixOS/nixpkgs#41844
I guess I'm fine with this behaviour then