Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named 'imp' #17

Closed
ftasbasi opened this issue Oct 3, 2023 · 4 comments
Closed

No module named 'imp' #17

ftasbasi opened this issue Oct 3, 2023 · 4 comments

Comments

@ftasbasi
Copy link

ftasbasi commented Oct 3, 2023

Traceback (most recent call last):
  File "/app/entrypoint.py", line 5, in <module>
    from main import Context
  File "/app/main.py", line 2, in <module>
    from j2cli.context import read_context_data
  File "/usr/local/lib/python3.12/site-packages/j2cli/__init__.py", line 10, in <module>
    from j2cli.cli import main
  File "/usr/local/lib/python3.12/site-packages/j2cli/cli.py", line 8, in <module>
    import imp, inspect
ModuleNotFoundError: No module named 'imp'

If I use Python version as 3.12 then this error is thrown. According to documentation, imp is deprecated in Python version 3.12.

@vvagaytsev
Copy link

@ftasbasi thanks for reporting this! I got into the same issue.

By the way, the documentation link is broken, it's https://docs.python.org/3/library/imp.html that points to the latest (currently 3.12) version that no longer supports imp. So it returns 404. You can fix it by changing it to https://docs.python.org/3.11/library/imp.html :)

@nyurik
Copy link

nyurik commented Oct 30, 2023

@cuchi all users of this great github action are affected it seems. Could you merge and release the #16 or fix it? Someone even created a forked version, but obviously it is better to keep things maintained in one place. Thanks for all your hard work!

ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

The script does not have a ".py" extension on purpose, to avoid being
picked by ansible-test.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 4, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

The script does not have a ".py" extension on purpose, to avoid being
picked by ansible-test.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
ptoscano added a commit to RedHatInsights/ansible-collections-insights that referenced this issue Nov 6, 2023
It looks like the cuchi/jinja2-action action is currently broken [1].
Since all we need is to render a jinja2 template with string variables,
then roll out a simple script Python using the "jinja2" module to do
that.

The script adds to the render context all the environment variables
starting with the prefix "JINJA_", removing it.

The script does not have a ".py" extension on purpose, to avoid being
picked by ansible-test.

[1] cuchi/jinja2-action#17

Signed-off-by: Pino Toscano <[email protected]>
@cuchi
Copy link
Owner

cuchi commented Nov 9, 2023

Thank you so much everyone that reported and worked on this.

The latest release is available at https://github.com/cuchi/jinja2-action/releases/tag/v1.2.2

@cuchi cuchi closed this as completed Nov 9, 2023
@nyurik
Copy link

nyurik commented Nov 9, 2023

@cuchi thanks so much for working on this! Would you be interested in adding more (trusted) people to your project to help you maintain it? For example, the @ajeffowens has became a popular fork of your project, but clearly it is better to merge the efforts, rather than maintain multiple forks. (I am assuming @ajeffowens would be ok with this)... or maybe some other devs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants