You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running makejinja in an alpine docker container results in AttributeError: 'Converter' object has no attribute '_structure_list'
To Reproduce
Steps to reproduce the behavior:
Use the following Dockerfile to build an image with docker build -t jinjatest .:
FROM python:3.9-alpine
WORKDIR /app
RUN pip install makejinja
Run docker run -it jinjatest makejinja
Expected behavior
Help menu appearing.
Additional Information
Full output:
$ docker run -it jinjatest makejinja
Traceback (most recent call last):
File "/usr/local/bin/makejinja", line 5, in<module>
from makejinja.cli import makejinja_cli
File "/usr/local/lib/python3.9/site-packages/makejinja/__init__.py", line 1, in<module>
from . import config, loader
File "/usr/local/lib/python3.9/site-packages/makejinja/config.py", line 5, in<module>
import typed_settings as ts
File "/usr/local/lib/python3.9/site-packages/typed_settings/__init__.py", line 6, in<module>
from ._core import default_loaders, load, load_settings
File "/usr/local/lib/python3.9/site-packages/typed_settings/_core.py", line 11, in<module>
from .attrs import METADATA_KEY
File "/usr/local/lib/python3.9/site-packages/typed_settings/attrs/__init__.py", line 21, in<module>
from .hooks import auto_convert
File "/usr/local/lib/python3.9/site-packages/typed_settings/attrs/hooks.py", line 98, in<module>
auto_convert = make_auto_converter(default_converter())
File "/usr/local/lib/python3.9/site-packages/typed_settings/converters.py", line 40, in default_converter
register_strlist_hook(converter, ":")
File "/usr/local/lib/python3.9/site-packages/typed_settings/converters.py", line 109, in register_strlist_hook
(is_sequence, converter._structure_list),
AttributeError: 'Converter' object has no attribute '_structure_list'
The text was updated successfully, but these errors were encountered:
Hi! The error you are facing is an issue with makejinja's dependency typed-settings. It uses cattrs without an upper version bound, and with the release of cattrs v24, this error is thrown. It is already fixed upstream (https://gitlab.com/sscherfke/typed-settings/-/merge_requests/40), but these changes are yet to be published in an official release.
Also please note that the Docker base image python:3.9-alpine will get you an outdated version of makejinja. Since about a year or so, we only support Python 3.11 and up, so you will likely want to use a newer Python version.
We even provide an official Docker image (https://github.com/mirkolenz/makejinja/pkgs/container/makejinja) that you can directly pull and run. The image should also be unaffected by the changes to cattrs because we pin all dependencies in a lock-file. More instructions can be found in makejinja's README.
Hope this helps! If so, feel free to close the issue 😄
Describe the bug
Running
makejinja
in an alpine docker container results inAttributeError: 'Converter' object has no attribute '_structure_list'
To Reproduce
Steps to reproduce the behavior:
Dockerfile
to build an image withdocker build -t jinjatest .
:docker run -it jinjatest makejinja
Expected behavior
Help menu appearing.
Additional Information
Full output:
The text was updated successfully, but these errors were encountered: