Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
global:module update
Browse files Browse the repository at this point in the history
removed unnecessary test modules

added some modules that your model.py needed.

modified test commands.

removed views since at this stage the module does not need it.

TODO:write tests for util.py to increase coverage. and add the model to the entrypoint ext.
  • Loading branch information
mb-wali committed Aug 26, 2020
1 parent bd430cd commit b8a47ad
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 106 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ after_success:

deploy:
provider: pypi
user: inveniosoftware
user: TODO:USER/TOKEN
password:
secure: TODO:PYPISECUREHASH
distributions: "compile_catalog sdist bdist_wheel"
on:
tags: true
python: "3.8"
python: "3.7"
repo: fair-data-austria/invenio-madmp
condition: $DEPLOY = true
16 changes: 16 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,19 @@ include .editorconfig
include .tx/config
prune docs/_build
recursive-include invenio_madmp/translations *.po *.pot *.mo

# added by check_manifest.py
include *.rst
include *.sh
include *.txt
include LICENSE
include babel.ini
include pytest.ini
recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include invenio_madmp *.html
recursive-include invenio_madmp *.py
recursive-include tests *.py
5 changes: 0 additions & 5 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,3 @@ API Docs
.. automodule:: invenio_madmp.ext
:members:

Views
-----

.. automodule:: invenio_madmp.views
:members:
9 changes: 0 additions & 9 deletions invenio_madmp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,3 @@
# under the terms of the MIT License; see LICENSE file for more details.

"""Invenio module for maDMP integration."""

# TODO: This is an example file. Remove it if your package does not use any
# extra configuration variables.

MADMP_DEFAULT_VALUE = 'foobar'
"""Default value for the application."""

MADMP_BASE_TEMPLATE = 'invenio_madmp/base.html'
"""Default base template for the demo page."""
10 changes: 0 additions & 10 deletions invenio_madmp/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class InveniomaDMP(object):

def __init__(self, app=None):
"""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:
self.init_app(app)

Expand All @@ -31,12 +27,6 @@ def init_app(self, app):

def init_config(self, app):
"""Initialize configuration."""
# Use theme's base template if theme is installed
if 'BASE_TEMPLATE' in app.config:
app.config.setdefault(
'MADMP_BASE_TEMPLATE',
app.config['BASE_TEMPLATE'],
)
for k in dir(config):
if k.startswith('MADMP_'):
app.config.setdefault(k, getattr(config, k))
15 changes: 0 additions & 15 deletions invenio_madmp/templates/invenio_madmp/base.html

This file was deleted.

14 changes: 0 additions & 14 deletions invenio_madmp/templates/invenio_madmp/index.html

This file was deleted.

29 changes: 0 additions & 29 deletions invenio_madmp/views.py

This file was deleted.

1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
pep8ignore = docs/conf.py ALL
addopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=invenio_madmp --cov-report=term-missing
testpaths = docs tests invenio_madmp
filterwarnings = ignore::pytest.PytestDeprecationWarning
4 changes: 2 additions & 2 deletions run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# under the terms of the MIT License; see LICENSE file for more details.

pydocstyle invenio_madmp tests docs && \
isort -rc -c -df && \
isort invenio_madmp tests --check-only --diff && \
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \
python setup.py test
pytest
24 changes: 13 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@
history = open('CHANGES.rst').read()

tests_require = [
'check-manifest>=0.25',
'coverage>=4.0',
'isort>=4.3.3',
'pydocstyle>=2.0.0',
'pytest-cov>=2.5.1',
'pytest-pep8>=1.0.6',
'pytest-invenio>=1.2.1',
'pytest-invenio>=1.3.2',
]

extras_require = {
'docs': [
'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,
}

Expand All @@ -42,6 +45,7 @@

install_requires = [
'Flask-BabelEx>=0.9.4',
'invenio-records>=1.3.2,<2.0.0'
]

packages = find_packages()
Expand Down Expand Up @@ -71,9 +75,7 @@
'invenio_base.apps': [
'invenio_madmp = invenio_madmp:InveniomaDMP',
],
'invenio_base.blueprints': [
'invenio_madmp = invenio_madmp.views:blueprint',
],
# 'invenio_base.blueprints': [],
'invenio_i18n.translations': [
'messages = invenio_madmp',
],
Expand Down Expand Up @@ -105,6 +107,6 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Development Status :: 1 - Planning',
'Development Status :: 3 - Alpha',
],
)
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from flask_babelex import Babel

from invenio_madmp import InveniomaDMP
from invenio_madmp.views import blueprint


@pytest.fixture(scope='module')
Expand All @@ -39,6 +38,5 @@ def factory(**config):
app.config.update(**config)
Babel(app)
InveniomaDMP(app)
app.register_blueprint(blueprint)
return app
return factory
7 changes: 0 additions & 7 deletions tests/test_invenio_madmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ def test_init():
assert 'invenio-madmp' not in app.extensions
ext.init_app(app)
assert 'invenio-madmp' in app.extensions


def test_view(base_client):
"""Test view."""
res = base_client.get("/")
assert res.status_code == 200
assert 'Welcome to Invenio-maDMP' in str(res.data)

0 comments on commit b8a47ad

Please sign in to comment.