Closed MPParsley closed 9 months ago
Current workaround:
openapi-spec-validator==0.4.0
See https://github.com/Pylons/pyramid_openapi3/issues/173
Next issue is
atramhasis_demo % pserve development.ini
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pyramid/config/actions.py", line 307, in execute_actions
callable(*args, **kw)
File "/usr/local/lib/python3.9/site-packages/pyramid_jinja2/__init__.py", line 449, in register
env = create_environment_from_options(env_opts, loader_opts)
File "/usr/local/lib/python3.9/site-packages/pyramid_jinja2/__init__.py", line 401, in create_environment_from_options
env = Environment(loader=loader, **env_opts)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 363, in __init__
self.extensions = load_extensions(self, extensions)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 117, in load_extensions
extension = t.cast(t.Type["Extension"], import_string(extension))
File "/usr/local/lib/python3.9/site-packages/jinja2/utils.py", line 149, in import_string
return getattr(__import__(module, None, None, [obj]), obj)
AttributeError: module 'jinja2.ext' has no attribute 'with_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/pserve", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.9/site-packages/pyramid/scripts/pserve.py", line 30, in main
return command.run()
File "/usr/local/lib/python3.9/site-packages/pyramid/scripts/pserve.py", line 271, in run
app = loader.get_wsgi_app(app_name, config_vars)
File "/usr/local/lib/python3.9/site-packages/plaster_pastedeploy/__init__.py", line 125, in get_wsgi_app
return loadapp(
File "/usr/local/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 248, in loadapp
return loadobj(APP, uri, name=name, **kw)
File "/usr/local/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 273, in loadobj
return context.create()
File "/usr/local/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 741, in create
return self.object_type.invoke(self)
File "/usr/local/lib/python3.9/site-packages/paste/deploy/loadwsgi.py", line 138, in invoke
return fix_call(context.object, context.global_conf, **context.local_conf)
File "/usr/local/lib/python3.9/site-packages/paste/deploy/util.py", line 61, in fix_call
val = callable(*args, **kw)
File "/Volumes/webdev/www/district09/opendata/atramhasis_demo/atramhasis_demo/__init__.py", line 53, in main
return config.make_wsgi_app()
File "/usr/local/lib/python3.9/site-packages/pyramid/config/__init__.py", line 891, in make_wsgi_app
self.commit()
File "/usr/local/lib/python3.9/site-packages/pyramid/config/actions.py", line 151, in commit
self.action_state.execute_actions(introspector=self.introspector)
File "/usr/local/lib/python3.9/site-packages/pyramid/config/actions.py", line 311, in execute_actions
reraise(
File "/usr/local/lib/python3.9/site-packages/pyramid/util.py", line 732, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.9/site-packages/pyramid/config/actions.py", line 307, in execute_actions
callable(*args, **kw)
File "/usr/local/lib/python3.9/site-packages/pyramid_jinja2/__init__.py", line 449, in register
env = create_environment_from_options(env_opts, loader_opts)
File "/usr/local/lib/python3.9/site-packages/pyramid_jinja2/__init__.py", line 401, in create_environment_from_options
env = Environment(loader=loader, **env_opts)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 363, in __init__
self.extensions = load_extensions(self, extensions)
File "/usr/local/lib/python3.9/site-packages/jinja2/environment.py", line 117, in load_extensions
extension = t.cast(t.Type["Extension"], import_string(extension))
File "/usr/local/lib/python3.9/site-packages/jinja2/utils.py", line 149, in import_string
return getattr(__import__(module, None, None, [obj]), obj)
pyramid.exceptions.ConfigurationExecutionError: <class 'AttributeError'>: module 'jinja2.ext' has no attribute 'with_'
in:
Line 488 of file /usr/local/lib/python3.9/site-packages/pyramid_jinja2/__init__.py:
config.add_jinja2_renderer(".jinja2", package=package)
Workaround, require:
jinja2<3
markupsafe<2
How did you install? The latest version (1.2.0) has openapi-spec-validator==0.4.0 in the requirements file. Did you try a different version?
@koenedaele, I installed as documented on
There are slight differences between both documentations.
I had to add these in order to run:
'pyramid_openapi3',
'openapi-spec-validator==0.4.0',
'jinja2<3',
'markupsafe<2',
I assume the problem is that the docs refer to https://github.com/OnroerendErfgoed/atramhasis_demo_cookiecutter and there these dependencies are still missing in https://github.com/OnroerendErfgoed/atramhasis_demo_cookiecutter/blob/main/%7B%7Bcookiecutter.repo%7D%7D/setup.py
@Wim-De-Clercq Is this still an issue with v2?
The v2 branch has this feature https://github.com/OnroerendErfgoed/atramhasis/pull/784 so the jinja2
and markupsafe
requirements will be fine with that.
The openapi-spec-validator==0.4.0
should already be part of atramhasis since 1.3.0.
The pyramid_openapi3
requirement is already part of atramhasis since 1.1.0.
However, due to https://github.com/Pylons/pyramid_openapi3/pull/206 we may want to already restrict it to <0.17
because that's definitely going to break things.
When running the python server the following error is thrown: