diff options
author | adisbladis | 2024-08-29 20:38:30 +1200 |
---|---|---|
committer | adisbladis | 2024-08-30 00:24:31 +1200 |
commit | 8cd58c7e149bc85af98d1697426a2ac5019ece29 (patch) | |
tree | 51526ddb0e42edde519f5fc66c52bee98deb2176 /doc | |
parent | ee2a36db7a5c61aa5393cf910f099d71482ec21a (diff) |
python3Packages.mkPythonMetaPackage: init
This function exists 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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/python.section.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 8992d36fb25b..ce83102acd84 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -361,6 +361,19 @@ 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 meta; + dependencies = [ psycopg2 ]; +} +``` + #### `python.buildEnv` function {#python.buildenv-function} Python environments can be created using the low-level `pkgs.buildEnv` function. |