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

ImportError: cannot import name 'contextfunction' from 'jinja2' #12

Open
jerinpetergeorge opened this issue Jan 3, 2023 · 1 comment

Comments

@jerinpetergeorge
Copy link

  • Date you used Cookiecutter PyPackage: 2023-01-03
  • Cookiecutter version used, if any:
  • Python version, if any: Python 3.8 (GH Action environment)
  • Operating System: Ubuntu 18.04 (GH Action environment)

Description

Created the package with default options, this is how I made the package,

╰─λ cookiecutter https://github.com/waynerv/cookiecutter-pypackage.git                                                                                                                                                   0 (0.021s) < 12:27:18
You've downloaded /home/jpg/.cookiecutters/cookiecutter-pypackage before. Is it okay to delete and re-download it? [yes]: yes
project_name [Python Boilerplate]: Django App Conf
project_slug [django-app-conf]: 
pkg_name [django_app_conf]: 
project_short_description [Skeleton project created by Cookiecutter PyPackage]: 
full_name [Xie Wei]: Jerin Peter George
email [[email protected]]: [email protected]
github_username [waynerv]: jerinpetergeorge
version [0.1.0]: 
Select command_line_interface:
1 - Click
2 - No command-line interface
Choose from 1, 2 [1]: 
Select open_source_license:
1 - MIT
2 - BSD-3-Clause
3 - ISC
4 - Apache-2.0
5 - GPL-3.0-only
6 - Not open source
Choose from 1, 2, 3, 4, 5, 6 [1]: 
Select docstrings_style:
1 - google
2 - numpy
3 - pep257
Choose from 1, 2, 3 [1]: 
use_mypy [y]:  
install_precommit_hooks [y]: 

Then, I pushed the code to GH (without running the tox or anything on my local machine). But, the CI has failed with the following error message ( see the full error log) -

ImportError: cannot import name 'contextfunction' from 'jinja2'

I expect the CI to be completed without any errors.

@jerinpetergeorge
Copy link
Author

This issue got resolved by adding jinja2 = {version = "<3.1.0", optional = true} to the pyproject.toml. Not sure if that is the best way to avoid the issue

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

1 participant