diff --git a/README.rst b/README.rst index e7e25a70848a33d29a8e51e9c42027e7b4239520..5199a208d6a10b28e7bb8ffd1792be85a31c44c3 100644 --- a/README.rst +++ b/README.rst @@ -20,6 +20,24 @@ Template A CLI tool for generating files from `Jinja2 <http://jinja.pocoo.org/>`_ templates and environment variables. + +Installation +------------ + +.. code:: shell + + pip install template[all] + + +This will install Template along with the dependencies for all of the filters +available with it. However, you can use narrower specifiers if you want to avoid +a specifc dependency (the filters listed below include the needed specifier). +In previous versions of Template all of the dependencies were required, so to +avoid breakage this behavior will be be kept. However, this will change in a +later release so the keep the expected behavior please update your project's +dependencies. + + Examples -------- @@ -52,14 +70,18 @@ Jinja filters The following Jinja filters were added: -- :code:`to_yaml`: Convert to yaml. -- :code:`from_yaml`: Convert from yaml. +- :code:`to_yaml`: Convert to yaml (requires the :code:`yaml` package + specifier). +- :code:`from_yaml`: Convert from yaml (requires the :code:`yaml` package + specifier). - :code:`to_json`: Convert to json. - :code:`from_json`: Convert from json. -- :code:`to_toml`: Convert to toml. -- :code:`from_toml`: Convert from toml. +- :code:`to_toml`: Convert to toml (requires the :code:`toml` package + specifier). +- :code:`from_toml`: Convert from toml (requires the :code:`toml` package + specifier). - :code:`jmespath`: Queries data using the `JMESPath <http://jmespath.org/>`_ - query language. + query language (requires the :code:`jmespath` package specifier). - :code:`run`: Runs a command and returns the stdout, stderr and returncode using `run <https://docs.python.org/3.6/library/subprocess.html?highlight=popen#subprocess.run>`_. diff --git a/setup.py b/setup.py index e6f9ece70b8421ebadd13a248295e16b0e706906..db521331eb19fc3200ff1573296ea18adc050cf2 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,12 @@ setup( "toml", "subprocess32>=3.5.0;python_version<'3.5'", ], - extras_require={"dev": ["pipenv"]}, + extras_require={ + "all": ["PyYAML", "jmespath", "toml"], + "dev": ["pipenv"], + "jmespath": ["jmespath"], + "toml": ["toml"], + "yaml": ["PyYAML"], + }, entry_points={"console_scripts": ["template=template:main"]}, )