Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

renderers

lib.renderers.withPackages

Type: withPackages :: AttrSet -> lambda

Renders a project as an argument that can be passed to withPackages

Evaluates PEP-508 environment markers to select correct dependencies for the platform but does not validate version constraints. For validation see lib.validators.

structured function argument
project

Project metadata as returned by lib.project.loadPyproject

python

Python derivation

pythonPackages

Nixpkgs Python package set

extras

Python extras (optionals) to enable

groups

PEP-735 dependency groups to enable.

extraPackages

Extra withPackages function

environ

PEP-508 environment

:: {.example #function-library-example-lib.renderers.withPackages}

lib.renderers.withPackages usage example

# withPackages (lib.project.loadPyproject { ... })
  «lambda @ «string»:1:1»

:::

lib.renderers.buildPythonPackage

Type: buildPythonPackage :: AttrSet -> AttrSet

Renders a project as an argument that can be passed to buildPythonPackage/buildPythonApplication.

Evaluates PEP-508 environment markers to select correct dependencies for the platform but does not validate version constraints. For validation see lib.validators.

structured function argument
project

Project metadata as returned by lib.project.loadPyproject

python

Python derivation

pythonPackages

Nixpkgs Python package set

extras

Python extras (optional-dependencies) to enable.

groups

PEP-735 dependency groups to enable.

extrasAttrMappings

Map a Python extras group name to a Nix attribute set like: { dev = “checkInputs”; } This is intended to be used with optionals such as test dependencies that you might want to remap to checkInputs.

format

Which package format to pass to buildPythonPackage If the format is “wheel” PEP-518 build-systems are excluded from the build.

environ

PEP-508 environment

:: {.example #function-library-example-lib.renderers.buildPythonPackage}

lib.renderers.buildPythonPackage usage example

# buildPythonPackage { project = lib.project.loadPyproject ...; python = pkgs.python3;  }
  { pname = "blinker"; version = "1.3.3.7"; dependencies = [ ]; }

:::

lib.renderers.mkPythonEditablePackage

Type: mkPythonEditablePackage :: AttrSet -> AttrSet

Renders a project as an argument that can be passed to mkPythonEditablePackage.

Evaluates PEP-508 environment markers to select correct dependencies for the platform but does not validate version constraints. For validation see lib.validators.

Note for Nix Flake users: Flakes are copied to the store when using pure evaluation, meaning that the project root will point to a store directory. Either set root manually to a string using the returned attribute set, or evaluate using --impure.

:: {.example #function-library-example-lib.renderers.mkPythonEditablePackage}

lib.renderers.mkPythonEditablePackage usage example

# mkPythonEditablePackage { project = lib.project.loadPyproject ...; python = pkgs.python3;  }
  { pname = "blinker"; version = "1.3.3.7"; dependencies = [ ]; }

:::

lib.renderers.meta

Type: meta :: AttrSet -> AttrSet

Renders a project as a meta attribute

This is used internally in renderers.mkPythonPackages

structured function argument
project

Function argument