Skip to content

Commit

Permalink
hooks: Remove obsolete hooks
Browse files Browse the repository at this point in the history
We don't need these any more since we can now do cross installs with uv.
  • Loading branch information
adisbladis committed Nov 24, 2024
1 parent 08e86b3 commit fd55c84
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 130 deletions.
68 changes: 1 addition & 67 deletions build/hooks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
lib,
stdenv,
hooks,
resolveBuildSystem,
pythonPkgsBuildHost,
runCommand,
}:
let
inherit (python) pythonOnBuildForHost isPy3k;
inherit (python) pythonOnBuildForHost;
inherit (pkgs) buildPackages;
pythonSitePackages = python.sitePackages;

Expand Down Expand Up @@ -81,30 +79,6 @@ in
inherit (buildPackages) uv;
};

/*
Build a pyproject.toml/setuptools project.
Used internally by `pyprojectHook`.
*/
pyprojectPypaBuildHook =
callPackage
(
_:
makeSetupHook {
name = "pyproject-pypa-build-hook";
substitutions = {
inherit (pythonPkgsBuildHost) build;
inherit pythonInterpreter;
};
propagatedBuildInputs = pythonPkgsBuildHost.resolveBuildSystem {
build = [ ];
};
} ./pyproject-pypa-build-hook.sh
)
{
inherit (buildPackages) python;
};

/*
Symlink prebuilt wheel sources.
Expand Down Expand Up @@ -137,46 +111,6 @@ in
inherit (buildPackages) uv;
};

/*
Install hook using pypa/installer.
Used instead of `pyprojectInstallHook` for cross compilation support.
*/
pyprojectPypaInstallHook = callPackage (
{ pythonPkgsBuildHost }:
makeSetupHook {
name = "pyproject-pypa-install-hook";
substitutions = {
inherit (pythonPkgsBuildHost) installer;
inherit pythonInterpreter pythonSitePackages;
};
} ./pyproject-pypa-install-hook.sh
) { };

/*
Clean up any shipped bytecode in package output and recompile.
Used internally by `pyprojectHook`.
*/
pyprojectBytecodeHook = callPackage (
_:
makeSetupHook {
name = "pyproject-bytecode-hook";
substitutions = {
inherit pythonInterpreter pythonSitePackages;
compileArgs = lib.concatStringsSep " " (
[
"-q"
"-f"
"-i -"
]
++ lib.optionals isPy3k [ "-j $NIX_BUILD_CORES" ]
);
bytecodeName = if isPy3k then "__pycache__" else "*.pyc";
};
} ./pyproject-bytecode-hook.sh
) { };

/*
Create `pyproject.nix` setup hook in package output.
Expand Down
19 changes: 0 additions & 19 deletions build/hooks/pyproject-bytecode-hook.sh

This file was deleted.

18 changes: 0 additions & 18 deletions build/hooks/pyproject-pypa-build-hook.sh

This file was deleted.

26 changes: 0 additions & 26 deletions build/hooks/pyproject-pypa-install-hook.sh

This file was deleted.

0 comments on commit fd55c84

Please sign in to comment.