project

lib.project.loadPyproject

Type: loadPyproject :: AttrSet -> AttrSet

Load dependencies from a PEP-621 pyproject.toml.

structured function argument

: pyproject

: The unmarshaled contents of pyproject.toml

extrasAttrPaths

: Example: extrasAttrPaths = [ "tool.pdm.dev-dependencies" ];

projectRoot

: Path to project root

::: {.example #function-library-example-lib.project.loadPyproject}

lib.project.loadPyproject usage example

# loadPyproject { pyproject = lib.importTOML }
{
  dependencies = { }; # Parsed dependency structure in the schema of `lib.pep621.parseDependencies`
  build-systems = [ ];  # Returned by `lib.pep518.parseBuildSystems`
  pyproject = { }; # The unmarshaled contents of pyproject.toml
  projectRoot = null; # Path to project root
  requires-python = null; # requires-python as parsed by pep621.parseRequiresPython
}

:::

lib.project.loadPDMPyproject

Type: loadPDMPyproject :: AttrSet -> AttrSet

Load dependencies from a PDM pyproject.toml.

structured function argument

: pyproject

: The unmarshaled contents of pyproject.toml

projectRoot

: Path to project root

pdmLock

: The unmarshaled contents of pdm.lock

::: {.example #function-library-example-lib.project.loadPDMPyproject}

lib.project.loadPDMPyproject usage example

# loadPyproject { pyproject = lib.importTOML }
{
  dependencies = { }; # Parsed dependency structure in the schema of `lib.pep621.parseDependencies`
  build-systems = [ ];  # Returned by `lib.pep518.parseBuildSystems`
  pyproject = { }; # The unmarshaled contents of pyproject.toml
  projectRoot = null; # Path to project root
  requires-python = null; # requires-python as parsed by pep621.parseRequiresPython
}

:::

lib.project.loadPoetryPyproject

Type: loadPoetryPyproject :: AttrSet -> AttrSet

Load dependencies from a Poetry pyproject.toml.

structured function argument

: pyproject

: The unmarshaled contents of pyproject.toml

projectRoot

: Path to project root

poetryLock

: The unmarshaled contents of pyproject.toml

::: {.example #function-library-example-lib.project.loadPoetryPyproject}

lib.project.loadPoetryPyproject usage example

# loadPoetryPyproject { pyproject = lib.importTOML }
{
  dependencies = { }; # Parsed dependency structure in the schema of `lib.pep621.parseDependencies`
  build-systems = [ ];  # Returned by `lib.pep518.parseBuildSystems`
  pyproject = { }; # The unmarshaled contents of pyproject.toml
  projectRoot = null; # Path to project root
  requires-python = null; # requires-python as parsed by pep621.parseRequiresPython
}

:::

lib.project.loadRequirementsTxt

Type: loadRequirementsTxt :: AttrSet -> AttrSet

Load dependencies from a requirements.txt.

Note that as requirements.txt is lacking important project metadata this is incompatible with some renderers.

structured function argument

: requirements

: The contents of requirements.txt

projectRoot

: Path to project root

::: {.example #function-library-example-lib.project.loadRequirementsTxt}

lib.project.loadRequirementsTxt usage example

# loadRequirementstxt { requirements = builtins.readFile ./requirements.txt; root = ./.; }
{
  dependencies = { }; # Parsed dependency structure in the schema of `lib.pep621.parseDependencies`
  build-systems = [ ];  # Returned by `lib.pep518.parseBuildSystems`
  pyproject = null; # The unmarshaled contents of pyproject.toml
  projectRoot = null; # Path to project root
  requires-python = null; # requires-python as parsed by pep621.parseRequiresPython
}

:::

lib.project.loadPyprojectDynamic

Type: loadPyprojectDynamic :: AttrSet -> AttrSet

Load dependencies from a either a PEP-621 or Poetry pyproject.toml file. This function is intended for 2nix authors that wants to include local pyproject.toml files but don't know up front whether they're from Poetry or PEP-621.

structured function argument

: pyproject

: The unmarshaled contents of pyproject.toml

projectRoot

: Path to project root

::: {.example #function-library-example-lib.project.loadPyprojectDynamic}

lib.project.loadPyprojectDynamic usage example

# loadPyprojectDynamic { pyproject = lib.importTOML }
{
  dependencies = { }; # Parsed dependency structure in the schema of `lib.pep621.parseDependencies`
  build-systems = [ ];  # Returned by `lib.pep518.parseBuildSystems`
  pyproject = { }; # The unmarshaled contents of pyproject.toml
  projectRoot = null; # Path to project root
  requires-python = null; # requires-python as parsed by pep621.parseRequiresPython
}

:::