Skip to content

Configuration

Angus Hollands edited this page May 11, 2022 · 11 revisions

literary provides a command-line interface literary <COMMAND> to run the various tools required to build and test a Python package. Although it is a design goal to allow users to make their own choice of package development tools and test frameworks, there are some necessary constraints. literary uses the traitlets configuration system as a default configuration source of any literary project.

Example Config

Invoking literary commands without any arguments will use defaults given by traitlets. These can be overridden in a custom literary_config.[py,json] file, e.g.

{
    "LiteraryApp": {
        "packages_dir": "src"
    },        
    "LiteraryBuildApp": {
        "generated_dir": "lib"
    },
    "LiteraryTestApp": {
        "extra_sources": ["examples"]
    }
}

This file must be placed in the project root directory. Any other traitlets configuration can be set in this file; it is sourced whenever a command-line program or the import hook is run.

Config Sections

The LiteraryApp configuration affects any Literary application. The implemented applications are subclasses of LiteraryApp, and implement additional configuration, corresponding to additional sections in the config file; e.g. LiteraryBuildApp. The shown keys have the following behaviours:

  • packages_dir sets the root of the project packages. This corresponds to having an src/ directory containing packages as subdirectories. In Literary's own repo, the literary package is placed in src/.
  • generated_dir sets the root of the generated packages. This corresponds to having a lib/ directory containing the converted packages at the same location in src/.
  • extra_sources sets the additional notebook locations for testing.

Notebook Development

Development of Literate notebooks using the IPython extension.

Package Development

Building packages from a collection of Literate notebooks.

Literary Development

About Literary

Clone this wiki locally