Skip to main content

Library and CLI for generating installation instructions from json schema and jinja templates.

Project description

installation-instruction

Library and CLI for generating installation instructions from json schema and jinja templates.

GitHub License PyPI - Version Documentation Status codecov FOSSA Status

Installation

pipx

pipx install installation-instruction

pip

python -m pip install installation-instruction

installation-instruction

(Don't try at home.)

name: installation-instruction
type: object
properties:
  method:
    enum:
      - pipx
      - pip
----------------------------------
{% if method == "pip" %}
  python -m pip
{% else %}
  pipx
{% endif %}
  install installation-instruction

CLI Usage

Usage: ibi [OPTIONS] COMMAND [ARGS]...

  Library and CLI for generating installation instructions from json schema
  and jinja templates.

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  install  Installs with config and parameters given.
  show     Shows installation instructions for your specified config file...

Options are dynamically created with the schema part of the config file.

[!TIP] Show help for a config file with: ibi show CONFIG_FILE --help.

Config

  • The config is comprised of a single file install.cfg.
  • The config has two parts delimited by ------ (6 or more -).
  • Both parts should be developed in different files for language server support.

Schema

  • The first section of the config is a json-schema.
  • It can be written in JSON or to JSON capabilites restricted YAML.
  • When creating a schema use the following schema draft version: https://json-schema.org/draft/2020-12/schema
  • title are used for pretty print option names.
  • description is used for the options help message.
  • anyOf with nested const and title are a special case as a replacement for enum but with pretty print name.

Template

  • You can have as much whitespace and line breaks as you wish in and inbetween your commands.
  • Commands must be seperated by &&! (pip install installation-instruction && pip uninstall installation-instruction.)
  • If you wish to stop the render from within the template you can use the macro raise. ({{ raise("no support!") }}.)

MISC

Please have a look at the examples.

Development installation

If you want to contribute to the development of installation_instruction, we recommend the following editable installation from this repository:

python -m pip install --editable .[tests]

Having done so, the test suite can be run using pytest:

python -m pytest

Contributors

Acknowledgments

This repository was set up using the SSC Cookiecutter for Python Packages.

License Scan

FOSSA Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

installation_instruction-0.3.0.tar.gz (15.0 kB view details)

Uploaded Source

File details

Details for the file installation_instruction-0.3.0.tar.gz.

File metadata

File hashes

Hashes for installation_instruction-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b2c0f2e3d483db43df5e79232aab6b7c12bce1700d7ee5511db5ce4635d9250f
MD5 2ad3462a03b582930e325d81a770bdaa
BLAKE2b-256 a4eb3b3f497038f9ebef13ed407bf9668e88e37ba2e6186feab008566e96cb6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page