Skip to content

Commit

Permalink
Merge 303f71e into f243ea1
Browse files Browse the repository at this point in the history
  • Loading branch information
Glignos committed Jun 28, 2019
2 parents f243ea1 + 303f71e commit b27a6d1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@
intersphinx_mapping = {
'https://docs.python.org/': None,
'Flask': (
'http://flask.pocoo.org/docs/0.11', None
'http://flask.pocoo.org/docs/1.0/', None
),
'Flask-Principal': (
# NOTE readthedocs version is currently broken
Expand Down
1 change: 1 addition & 0 deletions examples/app-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ npm install
cd ..
flask collect -v
flask assets build
flask webpack buildall

# Create the database
flask db init
Expand Down
1 change: 1 addition & 0 deletions examples/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ invenio-i18n>=1.0.0b1
invenio-pidstore>=1.0.0a9
invenio-rest[cors]>=1.0.0a9
invenio-theme>=1.0.0a17
urllib3>=1.21.1,<1.25
2 changes: 1 addition & 1 deletion invenio_deposit/views/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def __init__(self, serializers, pid_type, ctx, *args, **kwargs):
@use_kwargs(get_args)
@pass_record
@need_record_permission('read_permission_factory')
def get(self, pid, record, key, version_id, **kwargs):
def get(self, pid, record, key, version_id=None, **kwargs):
"""Get file.
Permission required: `read_permission_factory`.
Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
'check-manifest>=0.25',
'coverage>=4.0',
'invenio-access>=1.0.0a11',
'invenio-accounts>=1.0.0b1',
'invenio-accounts>=1.0.0',
'invenio-db[postgresql]>=1.0.1',
'isort>=4.2.2',
'psycopg2>=2.6.1',
'pydocstyle>=1.0.0',
'pytest-cache>=1.0',
'pytest-cov>=1.8.0',
Expand Down Expand Up @@ -66,19 +66,19 @@
'Flask-BabelEx>=0.9.3',
'Flask-Login>=0.3.2',
'Flask>=0.11.1',
'SQLAlchemy-Continuum>=1.3',
'SQLAlchemy-Utils[encrypted]>=0.32.6',
'SQLAlchemy-Continuum>=1.3,<1.3.5',
'SQLAlchemy-Utils[encrypted]>=0.33',
'dictdiffer>=0.5.0.post1',
'elasticsearch>=2.0.0,<3.0.0',
'elasticsearch-dsl>=2.0.0,<3.0.0',
'invenio-assets>=1.0.0b6',
'invenio-db[versioning]>=1.0.0b3',
'invenio-assets>=1.1.0',
'invenio-db[versioning]>=1.0.1',
'invenio-files-rest>=1.0.0a14',
'invenio-jsonschemas>=1.0.0a3',
'invenio-oauth2server>=1.0.0a12',
'invenio-oauth2server>=1.0.3',
'invenio-records-files>=1.0.0a8',
'invenio-records-rest>=1.0.0b5',
'invenio-records-ui>=1.0.0a8',
'invenio-records-rest>=1.1.0',
'invenio-records-ui>=1.0.1',
'invenio-search-ui>=1.0.0a5',
'invenio-search>=1.0.0a11',
]
Expand Down
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@
from invenio_records import InvenioRecords
from invenio_records_rest import InvenioRecordsREST
from invenio_records_rest.utils import PIDConverter
from invenio_records_rest.views import \
create_blueprint_from_app as records_rest_bp
from invenio_records_ui import InvenioRecordsUI
from invenio_records_ui.views import create_blueprint_from_app as records_ui_bp
from invenio_rest import InvenioREST
from invenio_search import InvenioSearch, current_search, current_search_client
from invenio_search_ui import InvenioSearchUI
Expand Down Expand Up @@ -144,6 +147,8 @@ def init_app(app_):
InvenioAssets(app)
InvenioSearchUI(app)
InvenioRecordsUI(app)
app.register_blueprint(records_ui_bp(app))
app.register_blueprint(records_rest_bp(app))
app.wsgi_app = DispatcherMiddleware(app.wsgi_app, {
'/api': api_app.wsgi_app
})
Expand Down Expand Up @@ -173,6 +178,7 @@ def app(base_app):
def api(base_app):
"""Yield the REST API application in its context."""
api = get_method_self(base_app.wsgi_app.mounts['/api'])
api.register_blueprint(records_rest_bp(api))
with api.app_context():
yield api

Expand Down
6 changes: 6 additions & 0 deletions tests/test_invenio_deposit.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ def test_conflict_in_endpoint_prefixes():
ext.init_config(app)

endpoints = app.config['RECORDS_REST_ENDPOINTS']
# Due to incompatibilty with how we are registering endpoints between
# invenio packages we need to now sanitize the endpoints registered in this
# test.
for endpoint in endpoints:
endpoints[endpoint].pop('error_handlers', None)

deposit_endpoints = deepcopy(app.config['DEPOSIT_REST_ENDPOINTS'])
deposit_endpoints['recid'] = endpoints['recid']
app.config['DEPOSIT_REST_ENDPOINTS'] = deposit_endpoints
Expand Down

0 comments on commit b27a6d1

Please sign in to comment.