about summary refs log tree commit diff
path: root/pkgs/development/python-modules/bootstrap/packaging
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-11-27 19:14:35 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-12-20 20:10:22 +0100
commit8f3162f83fcccf26bf50c55ff960fd2dee5264b2 (patch)
tree99e18c6ae853002a20552ddd5aa538da04ba189c /pkgs/development/python-modules/bootstrap/packaging
parenta648bdeede3883aeb2d9ecda43ad0f2455879abe (diff)
python3.pkgs.pythonRuntimeDepsCheckHook: init
Implements a hook, that checks whether all dependencies, as specified by
the wheel manifest, are present in the current environment.

Complains about missing packages, as well as version specifier
mismatches.
Diffstat (limited to 'pkgs/development/python-modules/bootstrap/packaging')
-rw-r--r--pkgs/development/python-modules/bootstrap/packaging/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/bootstrap/packaging/default.nix b/pkgs/development/python-modules/bootstrap/packaging/default.nix
new file mode 100644
index 0000000000000..f8a10d4ddd121
--- /dev/null
+++ b/pkgs/development/python-modules/bootstrap/packaging/default.nix
@@ -0,0 +1,30 @@
+{ stdenv
+, python
+, flit-core
+, installer
+, packaging
+}:
+
+stdenv.mkDerivation {
+  pname = "${python.libPrefix}-bootstrap-${packaging.pname}";
+  inherit (packaging) version src meta;
+
+  buildPhase = ''
+    runHook preBuild
+
+    PYTHONPATH="${flit-core}/${python.sitePackages}" \
+      ${python.interpreter} -m flit_core.wheel
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    PYTHONPATH="${installer}/${python.sitePackages}" \
+      ${python.interpreter} -m installer \
+        --destdir "$out" --prefix "" dist/*.whl
+
+    runHook postInstall
+  '';
+}