Skip to content
Snippets Groups Projects
Commit 615a59a5 authored by nimrod's avatar nimrod
Browse files

Package specifiers.

Allow installing just some of the dependencies. Some filters won't work,
but that's expected. Dcoument the change and keep all dependencies as
required for now to not cause unexpected breakage.
parent fe41afdc
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,24 @@ Template ...@@ -20,6 +20,24 @@ Template
A CLI tool for generating files from `Jinja2 <http://jinja.pocoo.org/>`_ A CLI tool for generating files from `Jinja2 <http://jinja.pocoo.org/>`_
templates and environment variables. 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 Examples
-------- --------
...@@ -52,14 +70,18 @@ Jinja filters ...@@ -52,14 +70,18 @@ Jinja filters
The following Jinja filters were added: The following Jinja filters were added:
- :code:`to_yaml`: Convert to yaml. - :code:`to_yaml`: Convert to yaml (requires the :code:`yaml` package
- :code:`from_yaml`: Convert from yaml. specifier).
- :code:`from_yaml`: Convert from yaml (requires the :code:`yaml` package
specifier).
- :code:`to_json`: Convert to json. - :code:`to_json`: Convert to json.
- :code:`from_json`: Convert from json. - :code:`from_json`: Convert from json.
- :code:`to_toml`: Convert to toml. - :code:`to_toml`: Convert to toml (requires the :code:`toml` package
- :code:`from_toml`: Convert from toml. specifier).
- :code:`from_toml`: Convert from toml (requires the :code:`toml` package
specifier).
- :code:`jmespath`: Queries data using the `JMESPath <http://jmespath.org/>`_ - :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 - :code:`run`: Runs a command and returns the stdout, stderr and returncode
using `run using `run
<https://docs.python.org/3.6/library/subprocess.html?highlight=popen#subprocess.run>`_. <https://docs.python.org/3.6/library/subprocess.html?highlight=popen#subprocess.run>`_.
......
...@@ -36,6 +36,12 @@ setup( ...@@ -36,6 +36,12 @@ setup(
"toml", "toml",
"subprocess32>=3.5.0;python_version<'3.5'", "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"]}, entry_points={"console_scripts": ["template=template:main"]},
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment