about summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorRobert Schütz2024-08-29 17:30:11 -0700
committerGitHub2024-08-29 17:30:11 -0700
commitc3925f7268a5fb104f304f8690f516441e1c1daa (patch)
tree59efcaaee296f58d47217a12e79dc0119da09aaa /doc
parentc66d9e2faa3ead38f8dca494e14a0ceaf99c7fd0 (diff)
parentd3e7844bbc92f9ca715431397586d30dd2201293 (diff)
mkPythonMetaPackage: init meta package function (and psycopg2-binary) (#337621)
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/python.section.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index 8992d36fb25b..833ff45c746e 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -361,6 +361,22 @@ modifications.
 
 Do pay attention to passing in the right Python version!
 
+#### `mkPythonMetaPackage` function {#mkpythonmetapackage-function}
+
+This will create a meta package containing [metadata files](https://packaging.python.org/en/latest/specifications/recording-installed-packages/) to satisfy a dependency on a package, without it actually having been installed into the environment.
+In nixpkgs this is used to package Python packages with split binary/source distributions such as [psycopg2](https://pypi.org/project/psycopg2/)/[psycopg2-binary](https://pypi.org/project/psycopg2-binary/).
+
+```nix
+mkPythonMetaPackage {
+  pname = "pscycopg2-binary";
+  inherit (psycopg2) optional-dependencies version;
+  dependencies = [ psycopg2 ];
+  meta = {
+    inherit (psycopg2.meta) description homepage;
+  };
+}
+```
+
 #### `python.buildEnv` function {#python.buildenv-function}
 
 Python environments can be created using the low-level `pkgs.buildEnv` function.