inveniosoftware-attic / invenio-ext

Invenio module that provides integration with Flask extensions.
GNU General Public License v2.0
0 stars 12 forks source link

restful: setup_app wrong arguments #26

Closed jmartinm closed 9 years ago

jmartinm commented 9 years ago

If the restful extension is enabled I get the following error:

18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2666, in load_entry_point
18:29:11 web.1       |     return ep.load()
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2339, in load
18:29:11 web.1       |     return self.resolve()
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2345, in resolve
18:29:11 web.1       |     module = __import__(self.module_name, fromlist=['__name__'], level=0)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/src/invenio-base/invenio_base/manage.py", line 28, in <module>
18:29:11 web.1       |     manager = Manager(create_app(), with_default_commands=False)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/src/invenio-base/invenio_base/factory.py", line 279, in create_app
18:29:11 web.1       |     extensions=ExtensionRegistry(app),
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/appdiscovery.py", line 153, in __init__
18:29:11 web.1       |     self.register(app, ext_name)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/appdiscovery.py", line 166, in register
18:29:11 web.1       |     ext(app)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/src/invenio-ext/invenio_ext/restful/__init__.py", line 344, in setup_app
18:29:11 web.1       |     'restful', app=app, with_setup=True
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/modulediscovery.py", line 254, in __init__
18:29:11 web.1       |     self.discover(app=app)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/modulediscovery.py", line 175, in discover
18:29:11 web.1       |     self._discover_module(pkg)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/modulediscovery.py", line 186, in _discover_module
18:29:11 web.1       |     self.register(module)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/src/invenio-ext/invenio_ext/restful/__init__.py", line 341, in register
18:29:11 web.1       |     *args, **kwargs)
18:29:11 web.1       |   File "/Users/jmartinm/.virtualenvs/inspire-latest-packagesv3/lib/python2.7/site-packages/flask_registry/registries/core.py", line 354, in register
18:29:11 web.1       |     setup_func(*args, **kwargs)
18:29:11 web.1       | TypeError: setup_app() takes exactly 1 argument (2 given)

which seems to be caused by passing the api parameter here which is not expected in the setup_app() function.

jmartinm commented 9 years ago

The problem was caused by having invenio_ext in the list of PACKAGES.