mirror of
https://github.com/vale981/poetry2nix
synced 2025-03-04 08:41:42 -05:00
fix: pull in hooks directly instead of sneaking them in through pythonPackages
This does technically break people that override hooks, but they deserve it.
This commit is contained in:
parent
3b9040d19e
commit
2c5c418746
3 changed files with 14 additions and 15 deletions
11
default.nix
11
default.nix
|
@ -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;
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue