============
hatch-tryton
============

A ``hatchling`` plugin to manage Tryton dependencies.

Usage
=====

#. Include it as a plugin to your ``pyproject.toml``:

   .. code:: toml

      [build-system]
      requires = ['hatchling', 'hatch-tryton']
      build-backend = 'hatchling.build'

#. Mark your ``version``, ``dependencies``, ``optional-dependencies``,
   ``readme`` and ``authors`` fields as ``dynamic``:

   .. code:: toml

      [project]
      dynamic = ['version', 'dependencies', 'optional-dependencies', 'authors', 'readme']

#. And configure the plugin:

   .. code:: toml

      [tool.hatch.metadata.hooks.tryton]
      # Path to the ``tryton.cfg`` file
      config = 'tryton.cfg'

      # Dictionary mapping module names to their package prefixes
      prefixes = {}

      # List of dependencies that are not Tryton modules
      dependencies = []

      # List of dependencies that are specifically Tryton modules
      tryton_dependencies = []

      # Path to the README file
      readme = ''

      # Path to the copyright file
      copyright = ''

      [tool.hatch.metadata.hooks.tryton.optional-dependencies]
      # Add any optional non-Tryton dependencies here

      [tool.hatch.metadata.hooks.tryton.tryton-optional-dependencies]
      # Add any optional Tryton dependencies here

.. note::

   The ``depends`` in ``tryton.cfg`` are added automatically as dependencies.

   The ``extras_depend`` in ``tryton.cfg`` are added automatically as ``test``
   option dependencies.
