Merge pull request #785 from K900/unhook

fix: pull in hooks directly instead of sneaking them in through pythonPackages
This commit is contained in:
adisbladis 2022-10-28 12:47:17 +13:00 committed by GitHub
commit d8c561ba4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 15 deletions

View file

@ -223,9 +223,6 @@ lib.makeScope pkgs.newScope (self: {
[
(
self: super:
let
hooks = self.callPackage ./hooks { };
in
{
mkPoetryDep = self.callPackage ./mk-poetry-dep.nix {
inherit lib python poetryLib evalPep508;
@ -236,8 +233,6 @@ lib.makeScope pkgs.newScope (self: {
poetry = poetryPkg;
__toPluginAble = toPluginAble self;
inherit (hooks) pipBuildHook removePathDependenciesHook removeGitDependenciesHook poetry2nixFixupHook wheelUnpackHook;
} // lib.optionalAttrs (! super ? setuptools-scm) {
# The canonical name is setuptools-scm
setuptools-scm = super.setuptools_scm;
@ -375,6 +370,8 @@ lib.makeScope pkgs.newScope (self: {
};
py = poetryPython.python;
hooks = py.pkgs.callPackage ./hooks { };
inherit (poetryPython) pyProject;
specialAttrs = [
"overrides"
@ -391,8 +388,8 @@ lib.makeScope pkgs.newScope (self: {
app = py.pkgs.buildPythonPackage (
passedAttrs // inputAttrs // {
nativeBuildInputs = inputAttrs.nativeBuildInputs ++ [
py.pkgs.removePathDependenciesHook
py.pkgs.removeGitDependenciesHook
hooks.removePathDependenciesHook
hooks.removeGitDependenciesHook
];
} // {
pname = normalizePackageName pyProject.tool.poetry.name;

View file

@ -89,6 +89,8 @@ pythonPackages.callPackage
};
format = if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format;
hooks = python.pkgs.callPackage ./hooks { };
in
buildPythonPackage {
pname = normalizePackageName name;
@ -103,18 +105,18 @@ pythonPackages.callPackage
dontStrip = format == "wheel";
nativeBuildInputs = [
pythonPackages.poetry2nixFixupHook
hooks.poetry2nixFixupHook
]
++ lib.optional (!isSource && (getManyLinuxDeps fileInfo.name).str != null) autoPatchelfHook
++ lib.optionals (format == "wheel") [
pythonPackages.wheelUnpackHook
hooks.wheelUnpackHook
pythonPackages.pipInstallHook
pythonPackages.setuptools
]
++ lib.optionals (format == "pyproject") [
pythonPackages.removePathDependenciesHook
pythonPackages.removeGitDependenciesHook
pythonPackages.pipBuildHook
hooks.removePathDependenciesHook
hooks.removeGitDependenciesHook
hooks.pipBuildHook
];
buildInputs = (

View file

@ -5,10 +5,10 @@
"homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "37bd39839acf99c5b738319f42478296f827f274",
"sha256": "1w7xby2paqgn4w1pkv0hr44xywlidmw3nq42naq6g3i3cni33hj3",
"rev": "5bdb380ee7fa036d47b19e9d854928f4881c50a1",
"sha256": "0jqvam3kpxwi6qq8w06f8l4l4s3dj5cvx79p48v9pjiij27kavxq",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/37bd39839acf99c5b738319f42478296f827f274.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/5bdb380ee7fa036d47b19e9d854928f4881c50a1.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}