Skip to content

buildPythonPackage

state: internal
maintainers: @DavHau

Introduction

Options

__contentAddressed

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

__darwinAllowLocalNetworking

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

__impureHostDeps

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

__propagatedImpureHostDeps

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

__structuredAttrs

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

allowSubstitutes

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

allowedReferences

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

allowedRequisites

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

args

type null or (list of (string or path))
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

build-system

Build-time only Python dependencies. Items listed in build-system.requires/setup_requires.

type list of (string or path or package)
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

buildFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

buildInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

buildPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

builder

type null or string or path or package or (submodule)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

catchConflicts

Raise an error if two packages are installed with the same name TODO: For cross we probably need a different PYTHONPATH, or not add the runtime deps until after buildPhase.

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
''
  true if the host and build platforms are the same, false otherwise.
''

checkFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

checkInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

checkPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

checkTarget

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

cmakeFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

configureFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

configurePhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

configurePlatforms

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

configureScript

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dependencies

List of runtime python dependencies. Aside from propagating dependencies, buildPythonPackage also injects code into and wraps executables with the paths included in this list. Items listed in install_requires go here.

type list of (string or path or package)
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

deps

All dependencies of the package. This option should be set by the "outer world" and can be used to inherit attributes from pkgs or inputs etc.

By separating the task of retrieving things from the outside world, it is ensured that the dependencies are overridable. Nothing will stop users from adding nixpkgs itself as a dependency, but this will make it very hard for the user of the package to override any dependencies, because they'd have to figure out a way to insert their changes into the Nixpkgs fixpoint. By adding specific attributes to deps instead, the user has a realistic chance of overriding those dependencies.

So deps should be specific, but not overly specific. For instance, the caller shouldn't have to know the version of a dependency in order to override it. The name should suffice. (e.g. nix = nixVersions.nix_2_12 instead of inherit (nixVersions) nix_2_12.

type lazy attribute set of raw value
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix, dream2nix/modules/dream2nix/core/deps, dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
{ }
example
{nixpkgs, ...}: {
  inherit (nixpkgs) stdenv;
  inherit (nixpkgs.haskellPackages) pandoc;
}

deps.python

The python interpreter package to use

type package
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix

deps.stdenv

The stdenv used for building this package

type raw value
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix

depsBuildBuild

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsBuildBuildPropagated

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsBuildTarget

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsBuildTargetPropagated

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsHostHost

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsHostHostPropagated

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsTargetTarget

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

depsTargetTargetPropagated

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

disabled

used to disable derivation, useful for specific python versions

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
false

disabledTestPaths

Test paths to ignore in checkPhase

type list of anything
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

disabledTests

Disable running specific unit tests

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

disallowedReferences

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

disallowedRequisites

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

distFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

distPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

distTarget

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

doCheck

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

doDist

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

doInstallCheck

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontAddDisableDepTrack

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontAddPrefix

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontAddStaticConfigureFlags

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontBuild

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontConfigure

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontCopyDist

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontDisableStatic

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontFixLibtool

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontFixup

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontInstall

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontMakeSourcesWritable

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontMoveBin

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontPatch

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontPatchELF

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontPatchShebangs

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontPruneLibtoolFiles

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontStrip

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontStripHost

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontStripTarget

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontUnpack

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

dontUsePipInstall

Don't use Pip to install a wheel Note this is actually a variable for the pipInstallPhase in pip's setupHook. It's included here to prevent an infinite recursion.

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
false

dontWrapPythonPrograms

Skip wrapping of python programs altogether

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
false

enableParallelBuilding

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

enableParallelChecking

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

env

environment variables passed to the build environment

type attribute set of (null or boolean or signed integer or string or path or package or list of (boolean or signed integer or string or path or package))
source dream2nix/modules/dream2nix/core/env
default
{ }

exportReferenceGraph

type null or (list of (string or package))
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

fixupPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

forceShare

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

format

Several package formats are supported: null: Disable this legacy option and use the new pyproject option instead. "setuptools" : Install a common setuptools/distutils based package. This builds a wheel. "wheel" : Install from a pre-compiled wheel. "flit" : Install a flit package. This builds a wheel. "pyproject": Install a package using a pyproject.toml file (PEP517). This builds a wheel. "egg": Install a package from an egg. "other" : Provide your own buildPhase and installPhase.

type null or string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
''
  "setuptools" if `pyproject` is `null`, otherwise `null`
''

hardeningDisable

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

hardeningEnable

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

impureEnvVars

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installCheckFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installCheckInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installCheckPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installCheckTarget

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

installTargets

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

makeFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

makeWrapperArgs

Additional arguments to pass to the makeWrapper function, which wraps generated binaries.

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

makefile

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

mesonFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

meta

type null or (attribute set)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
{ }

name

The name of the package

type string
source dream2nix/modules/dream2nix/core/ui/interface.nix

nativeBuildInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

nativeCheckInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

optional-dependencies

Optional feature flagged dependencies. Items listed in extras_requires go here.

type attribute set of (string or path or package)
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
{ }

outputHash

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

outputHashAlgo

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

outputHashMode

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

outputs

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
[
  "out"
]

passAsFile

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

passthru

type null or (attribute set)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
{ }

patchFlags

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

patchPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

patches

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

permitUserSite

Skip setting the PYTHONNOUSERSITE environment variable in wrapped programs

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
false

phases

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

pipInstallFlags

Extra flags passed to pip install

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

pos

type null or (attribute set)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
{ }

postBuild

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postCheck

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postConfigure

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postDist

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postFixup

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postInstalCheck

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postInstall

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postPatch

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postPhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

postUnpack

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preBuild

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preBuildPhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preCheck

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preConfigure

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preConfigurePhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preDist

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preDistPhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preFixup

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preFixupPhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preInstall

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preInstallCheck

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preInstallPhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

prePatch

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

prePhases

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preUnpack

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

preferLocalBuild

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

prefix

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

prefixKey

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

propagatedBuildInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

propagatedNativeBuildInputs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

propagatedSandboxProfile

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

public

The final result of the evaluated package. Contains everything that nix expects from a derivation. Contains fields like name, outputs, drvPath, outPath, etc. Can be build with nix-build or nix build.

type lazy attribute set of anything
source dream2nix/modules/dream2nix/core/public/interface.nix

pyproject

Whether the pyproject format should be used. When set to true, pypaBuildHook will be used, and you can add the required build dependencies from build-system.requires to build-system.

Note that the pyproject format falls back to using setuptools, so you can use pyproject = true even if the package only has a setup.py. When set to false, you can use the existing hooks or provide your own logic to build the package. This can be useful for packages that don't support the pyproject format.

When unset, the legacy setuptools hooks are used for backwards compatibility.

type null or boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
null

pytestFlagsArray

Extra flags passed to pytest

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

pythonImportsCheck

Check whether importing the listed modules works

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

pythonRelaxDeps

List of dependency names on which to remove version constraints. Or the boolean value true to remove all of them

type (list of string) or boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

pythonRemoveDeps

List of dependency names which to remove.

type list of string
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
[ ]

realBuilder

type null or string or path or package or (submodule)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

removeBinBytecode

Remove bytecode from bin folder. When a Python script has the extension .py, bytecode is generated Typically, executables in bin have no extension, so no bytecode is generated. However, some packages do provide executables with extensions, and thus bytecode is generated.

type boolean
source dream2nix/modules/dream2nix/buildPythonPackage-mixin/interface.nix
default
true

requiredSystemFeatures

type null or (list of string)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

sandboxProfile

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

separateDebugInfo

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

setSourceRoot

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

setupHook

type null or string or path or package or (submodule)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

shellHook

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

sourceRoot

type null or string or path or package or (submodule)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

src

type null or string or path or package or (submodule)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

srcs

type null or (list of (string or path or package))
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

strictDeps

type null or boolean
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

stripAllFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

stripAllList

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

stripDebugFlags

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

stripDebugList

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

tarballs

type null or (list of anything)
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

unpackCmd

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

unpackPhase

type null or string
source dream2nix/modules/dream2nix/mkDerivation-mixin/interface.nix
default
null

version

The version of the package

type string
source dream2nix/modules/dream2nix/core/ui/interface.nix