mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2025-12-23 13:31:58 +00:00
module modification
updated the module structure
This commit is contained in:
11
.travis.yml
11
.travis.yml
@@ -33,7 +33,6 @@ python:
|
|||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- "nvm install 6; nvm use 6"
|
- "nvm install 6; nvm use 6"
|
||||||
- "sudo apt-get install -y libxml2-dev libxmlsec1-dev"
|
|
||||||
- "travis_retry pip install --upgrade pip setuptools py"
|
- "travis_retry pip install --upgrade pip setuptools py"
|
||||||
- "travis_retry pip install twine wheel coveralls requirements-builder"
|
- "travis_retry pip install twine wheel coveralls requirements-builder"
|
||||||
- "requirements-builder -e all --level=min setup.py > .travis-lowest-requirements.txt"
|
- "requirements-builder -e all --level=min setup.py > .travis-lowest-requirements.txt"
|
||||||
@@ -51,13 +50,15 @@ after_success:
|
|||||||
- coveralls
|
- coveralls
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
|
skip_cleanup: true
|
||||||
|
skip_existing: true
|
||||||
provider: pypi
|
provider: pypi
|
||||||
user: inveniosoftware
|
username: __token__
|
||||||
password:
|
password:
|
||||||
secure: TODO:PYPISECUREHASH
|
secure: Token here
|
||||||
distributions: "compile_catalog sdist bdist_wheel"
|
distributions: sdist bdist_wheel
|
||||||
on:
|
on:
|
||||||
tags: true
|
tags: true
|
||||||
python: "3.6"
|
python: "3.6"
|
||||||
repo: https://github.com/mb-wali/invenio-config-tugraz
|
repo: mb-wali/invenio-config-tugraz
|
||||||
condition: $DEPLOY = true
|
condition: $DEPLOY = true
|
||||||
|
|||||||
@@ -11,9 +11,3 @@ API Docs
|
|||||||
|
|
||||||
.. automodule:: invenio_config_tugraz.ext
|
.. automodule:: invenio_config_tugraz.ext
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
Views
|
|
||||||
-----
|
|
||||||
|
|
||||||
.. automodule:: invenio_config_tugraz.views
|
|
||||||
:members:
|
|
||||||
|
|||||||
@@ -10,12 +10,8 @@
|
|||||||
|
|
||||||
from flask_babelex import gettext as _
|
from flask_babelex import gettext as _
|
||||||
|
|
||||||
INVENIO_CONFIG_TUGRAZ_DEFAULT_VALUE = 'foobar'
|
INVENIO_CONFIG_TUGRAZ_SHIBBOLETH = True
|
||||||
"""Default value for the application."""
|
"""Set True if SAML is configured"""
|
||||||
|
|
||||||
INVENIO_CONFIG_TUGRAZ_BASE_TEMPLATE = 'invenio_config_tugraz/base.html'
|
|
||||||
"""Default base template for the demo page."""
|
|
||||||
|
|
||||||
|
|
||||||
# Invenio-App
|
# Invenio-App
|
||||||
# ===========
|
# ===========
|
||||||
@@ -94,9 +90,6 @@ MAIL_SUPPRESS_SEND = False
|
|||||||
# ===========
|
# ===========
|
||||||
# See https://invenio-shibboleth.readthedocs.io/en/latest/configuration.html
|
# See https://invenio-shibboleth.readthedocs.io/en/latest/configuration.html
|
||||||
|
|
||||||
INVENIO_CONFIG_TUGRAZ_SHIBBOLETH = True
|
|
||||||
"""Set True if SAML is configured"""
|
|
||||||
|
|
||||||
USERPROFILES_EXTEND_SECURITY_FORMS = True
|
USERPROFILES_EXTEND_SECURITY_FORMS = True
|
||||||
"""Set True in order to register user_profile.
|
"""Set True in order to register user_profile.
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,6 @@ class invenioconfigtugraz(object):
|
|||||||
|
|
||||||
def __init__(self, app=None):
|
def __init__(self, app=None):
|
||||||
"""Extension initialization."""
|
"""Extension initialization."""
|
||||||
# TODO: This is an example of translation string with comment. Please
|
|
||||||
# remove it.
|
|
||||||
# NOTE: This is a note to a translator.
|
|
||||||
_('A translation string')
|
|
||||||
if app:
|
if app:
|
||||||
self.init_app(app)
|
self.init_app(app)
|
||||||
|
|
||||||
@@ -32,12 +28,6 @@ class invenioconfigtugraz(object):
|
|||||||
|
|
||||||
def init_config(self, app):
|
def init_config(self, app):
|
||||||
"""Initialize configuration."""
|
"""Initialize configuration."""
|
||||||
# Use theme's base template if theme is installed
|
|
||||||
if 'BASE_TEMPLATE' in app.config:
|
|
||||||
app.config.setdefault(
|
|
||||||
'INVENIO_CONFIG_TUGRAZ_BASE_TEMPLATE',
|
|
||||||
app.config['BASE_TEMPLATE'],
|
|
||||||
)
|
|
||||||
for k in dir(config):
|
for k in dir(config):
|
||||||
if k.startswith('INVENIO_CONFIG_TUGRAZ_'):
|
if k.startswith('INVENIO_CONFIG_TUGRAZ_'):
|
||||||
app.config.setdefault(k, getattr(config, k))
|
app.config.setdefault(k, getattr(config, k))
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{#
|
|
||||||
Copyright (C) 2020 Mojib Wali.
|
|
||||||
|
|
||||||
invenio-config-tugraz is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the MIT License; see LICENSE file for more
|
|
||||||
details.
|
|
||||||
#}
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{%- block page_body %}{%- endblock page_body %}
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{#
|
|
||||||
Copyright (C) 2020 Mojib Wali.
|
|
||||||
|
|
||||||
invenio-config-tugraz is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the MIT License; see LICENSE file for more
|
|
||||||
details.
|
|
||||||
#}
|
|
||||||
|
|
||||||
{%- extends config.INVENIO_CONFIG_TUGRAZ_BASE_TEMPLATE %}
|
|
||||||
|
|
||||||
{%- block page_body %}
|
|
||||||
TODO: Example template, please remove if you do not need it.
|
|
||||||
{{_('Welcome to %(module_name)s', module_name=module_name)}}
|
|
||||||
{%- endblock %}
|
|
||||||
|
|
||||||
@@ -12,4 +12,4 @@ This file is imported by ``invenio_config_tugraz.__init__``,
|
|||||||
and parsed by ``setup.py``.
|
and parsed by ``setup.py``.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '1.0.0.dev20200000'
|
__version__ = '0.1.0'
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
#
|
|
||||||
# Copyright (C) 2020 Mojib Wali.
|
|
||||||
#
|
|
||||||
# invenio-config-tugraz is free software; you can redistribute it and/or
|
|
||||||
# modify it under the terms of the MIT License; see LICENSE file for more
|
|
||||||
# details.
|
|
||||||
|
|
||||||
"""invenio module that adds tugraz configs."""
|
|
||||||
|
|
||||||
# TODO: This is an example file. Remove it if you do not need it, including
|
|
||||||
# the templates and static folders as well as the test case.
|
|
||||||
|
|
||||||
from flask import Blueprint, render_template
|
|
||||||
from flask_babelex import gettext as _
|
|
||||||
|
|
||||||
blueprint = Blueprint(
|
|
||||||
'invenio_config_tugraz',
|
|
||||||
__name__,
|
|
||||||
template_folder='templates',
|
|
||||||
static_folder='static',
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route("/")
|
|
||||||
def index():
|
|
||||||
"""Render a basic view."""
|
|
||||||
return render_template(
|
|
||||||
"invenio_config_tugraz/index.html",
|
|
||||||
module_name=_('invenio-config-tugraz'))
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
# details.
|
# details.
|
||||||
|
|
||||||
pydocstyle invenio_config_tugraz tests docs && \
|
pydocstyle invenio_config_tugraz tests docs && \
|
||||||
isort -rc -c -df && \
|
isort --check-only --diff && \
|
||||||
check-manifest --ignore ".travis-*" && \
|
check-manifest --ignore ".travis-*" && \
|
||||||
sphinx-build -qnNW docs docs/_build/html && \
|
sphinx-build -qnNW docs docs/_build/html && \
|
||||||
python setup.py test
|
python setup.py test
|
||||||
|
|||||||
34
setup.py
34
setup.py
@@ -16,28 +16,13 @@ readme = open('README.rst').read()
|
|||||||
history = open('CHANGES.rst').read()
|
history = open('CHANGES.rst').read()
|
||||||
|
|
||||||
tests_require = [
|
tests_require = [
|
||||||
'check-manifest>=0.25',
|
'pytest-invenio>=1.3.2',
|
||||||
'coverage>=4.0',
|
|
||||||
'isort>=4.3.3, <5.0.0',
|
|
||||||
'pydocstyle>=2.0.0',
|
|
||||||
'pytest-cov>=2.5.1',
|
|
||||||
'pytest-pep8>=1.0.6',
|
|
||||||
'pytest-invenio>=1.2.1',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
extras_require = {
|
extras_require = {
|
||||||
'docs': [
|
'docs': [
|
||||||
'Sphinx>=1.5.1',
|
'Sphinx>=1.5.1',
|
||||||
],
|
],
|
||||||
'mysql': [
|
|
||||||
'invenio-db[mysql]>=1.0.0',
|
|
||||||
],
|
|
||||||
'postgresql': [
|
|
||||||
'invenio-db[postgresql]>=1.0.0',
|
|
||||||
],
|
|
||||||
'sqlite': [
|
|
||||||
'invenio-db>=1.0.0',
|
|
||||||
],
|
|
||||||
'tests': tests_require,
|
'tests': tests_require,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +37,6 @@ setup_requires = [
|
|||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
'Flask-BabelEx>=0.9.4',
|
'Flask-BabelEx>=0.9.4',
|
||||||
'invenio_oauthclient>=1.2.1',
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -83,26 +67,12 @@ setup(
|
|||||||
'invenio_base.apps': [
|
'invenio_base.apps': [
|
||||||
'invenio_config_tugraz = invenio_config_tugraz:invenioconfigtugraz',
|
'invenio_config_tugraz = invenio_config_tugraz:invenioconfigtugraz',
|
||||||
],
|
],
|
||||||
'invenio_base.blueprints': [
|
|
||||||
'invenio_config_tugraz = invenio_config_tugraz.views:blueprint',
|
|
||||||
],
|
|
||||||
'invenio_i18n.translations': [
|
'invenio_i18n.translations': [
|
||||||
'messages = invenio_config_tugraz',
|
'messages = invenio_config_tugraz',
|
||||||
],
|
],
|
||||||
'invenio_config.module': [
|
'invenio_config.module': [
|
||||||
'invenio_config_tugraz = invenio_config_tugraz.config',
|
'invenio_config_tugraz = invenio_config_tugraz.config',
|
||||||
],
|
],
|
||||||
# TODO: Edit these entry points to fit your needs.
|
|
||||||
# 'invenio_access.actions': [],
|
|
||||||
# 'invenio_admin.actions': [],
|
|
||||||
# 'invenio_assets.bundles': [],
|
|
||||||
# 'invenio_base.api_apps': [],
|
|
||||||
# 'invenio_base.api_blueprints': [],
|
|
||||||
# 'invenio_base.blueprints': [],
|
|
||||||
# 'invenio_celery.tasks': [],
|
|
||||||
# 'invenio_db.models': [],
|
|
||||||
# 'invenio_pidstore.minters': [],
|
|
||||||
# 'invenio_records.jsonresolver': [],
|
|
||||||
},
|
},
|
||||||
extras_require=extras_require,
|
extras_require=extras_require,
|
||||||
install_requires=install_requires,
|
install_requires=install_requires,
|
||||||
@@ -120,6 +90,6 @@ setup(
|
|||||||
'Programming Language :: Python :: 3.6',
|
'Programming Language :: Python :: 3.6',
|
||||||
'Programming Language :: Python :: 3.7',
|
'Programming Language :: Python :: 3.7',
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Development Status :: 1 - Planning',
|
'Development Status :: 3 - Alpha',
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from flask import Flask
|
|||||||
from flask_babelex import Babel
|
from flask_babelex import Babel
|
||||||
|
|
||||||
from invenio_config_tugraz import invenioconfigtugraz
|
from invenio_config_tugraz import invenioconfigtugraz
|
||||||
from invenio_config_tugraz.views import blueprint
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='module')
|
@pytest.fixture(scope='module')
|
||||||
@@ -40,6 +39,5 @@ def create_app(instance_path):
|
|||||||
app.config.update(**config)
|
app.config.update(**config)
|
||||||
Babel(app)
|
Babel(app)
|
||||||
invenioconfigtugraz(app)
|
invenioconfigtugraz(app)
|
||||||
app.register_blueprint(blueprint)
|
|
||||||
return app
|
return app
|
||||||
return factory
|
return factory
|
||||||
|
|||||||
@@ -30,10 +30,3 @@ def test_init():
|
|||||||
assert 'invenio-config-tugraz' not in app.extensions
|
assert 'invenio-config-tugraz' not in app.extensions
|
||||||
ext.init_app(app)
|
ext.init_app(app)
|
||||||
assert 'invenio-config-tugraz' in app.extensions
|
assert 'invenio-config-tugraz' in app.extensions
|
||||||
|
|
||||||
|
|
||||||
def test_view(base_client):
|
|
||||||
"""Test view."""
|
|
||||||
res = base_client.get("/")
|
|
||||||
assert res.status_code == 200
|
|
||||||
assert 'Welcome to invenio-config-tugraz' in str(res.data)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user