poetry

lib.poetry.translatePoetryProject

Type: translatePoetryProject :: AttrSet -> lambda

Translate a Pyproject.toml from Poetry to PEP-621 project metadata. This function transposes a PEP-621 project table on top of an existing Pyproject.toml populated with data from tool.poetry. Notably does not translate dependencies/optional-dependencies.

For parsing dependencies from Poetry see lib.poetry.parseDependencies.

pyproject

: Function argument

::: {.example #function-library-example-lib.poetry.translatePoetryProject}

lib.poetry.translatePoetryProject usage example

# translatePoetryProject (lib.importTOML ./pyproject.toml)
{ }  # TOML contents, structure omitted. See PEP-621 for more information on data members.

:::

lib.poetry.parseDependencies

Type: parseDependencies :: AttrSet -> AttrSet

Parse dependencies from pyproject.toml (Poetry edition). This function is analogous to lib.pep621.parseDependencies.

pyproject

: Function argument

::: {.example #function-library-example-lib.poetry.parseDependencies}

lib.poetry.parseDependencies usage example

# parseDependencies {
#
#   pyproject = (lib.importTOML ./pyproject.toml);
# }
{
  dependencies = [ ];  # List of parsed PEP-508 strings (lib.pep508.parseString)
  extras = {
    dev = [ ];  # List of parsed PEP-508 strings (lib.pep508.parseString)
  };
  build-systems = [ ];  # PEP-518 build-systems (List of parsed PEP-508 strings)
}

:::

lib.poetry.parseVersionCond

Type: parseVersionCond :: string -> [ AttrSet ]

Parse a version conditional. Supports additional non-standard operators ^ and ~ used by Poetry.

Because some expressions desugar to multiple expressions parseVersionCond returns a list.

cond

: Function argument