Coder Social home page Coder Social logo

amannocci / temply Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 0.0 9.63 MB

Render jinja2 templates using the command line without python runtime.

License: Apache License 2.0

Python 97.36% Dockerfile 2.64%
binary docker environment jinja2 kubernetes podman template

temply's People

Contributors

amannocci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

temply's Issues

Remove path dependency

Description

Currently, we use path library to handle files.
We could replace it by pathlib library.

Upgrade to Python 3.8.x

Description

Currently, we use an old version of Python 3.6 which isn't supported anymore.
We can safely upgrade to Python 3.8.x.

Migrate to poetry

Describe the solution you'd like
Migrate to poetry for dependency management

Add support for validation filters

Describe the solution you'd like
Add support for validation filter.
It will allow to validate of template variables within the template itself.

Correct missing module

Traceback (most recent call last):
  File "site-packages/PyInstaller/loader/rthooks/pyi_rth_pkgres.py", line 13, in <module>
  File "/home/travis/virtualenv/python3.6.7/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
  File "site-packages/pkg_resources/__init__.py", line 85, in <module>
ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

Add support for file

Describe the solution you'd like
Support file as source of variables :

  • From dotenv file
  • From an envdir

Unknown tag 'X'

Describe the bug
when executing temply --keep-template -o on a template file containing %X, the command fails.

opt/symphony/app/conf$ temply --keep-template -o log4j2-spring.xml log4j2-spring.xml.tpl
Traceback (most recent call last):
File "temply", line 5, in
File "click/core.py", line 829, in call
File "click/core.py", line 782, in main
File "click/core.py", line 1066, in invoke
File "click/core.py", line 610, in invoke
File "temply/temply.py", line 70, in main
File "jinja2/environment.py", line 883, in get_template
File "jinja2/environment.py", line 857, in _load_template
File "jinja2/loaders.py", line 127, in load
File "jinja2/environment.py", line 638, in compile
File "jinja2/environment.py", line 832, in handle_exception
File "jinja2/_compat.py", line 28, in reraise
File "/opt/symphony/app/conf/log4j2-spring.xml.tpl", line 12, in template

jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'X'.
[7751] Failed to execute script 'temply' due to unhandled exception!

To Reproduce

  • Create a xml file and add ,
  • run the command temply --keep-template -o

Expected behavior
command runs successful and the file gets rendered.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.