Skip to content

Commit

Permalink
Complete TODO items, remove index page and test
Browse files Browse the repository at this point in the history
  • Loading branch information
spilth committed Oct 29, 2024
1 parent c81e27a commit 8be8857
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 92 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ name: CI

on:
push:
branches: master
branches: main
pull_request:
branches:
- master
- main
- "maint-**"
schedule:
# * is a special character in YAML so you have to quote this string
Expand All @@ -31,24 +31,9 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
# TODO: You can add/remove combinations e.g. `dev` requirements or
# `postgresql13` by adding a new item to the following lists.
# You can see the complete list of services and versions that are available at:
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html
python-version: ['3.9', '3.12']
db-service: [postgresql14]
search-service: [opensearch2]
include:
- db-service: postgresql14
DB_EXTRAS: "postgresql"

- search-service: opensearch2
SEARCH_EXTRAS: "opensearch2"

env:
DB: ${{ matrix.db-service }}
SEARCH: ${{ matrix.search-service }}
# TODO: Adapt EXTRAS accordingly
EXTRAS: tests,${{ matrix.search-service }}

steps:
Expand Down
13 changes: 6 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,28 @@
# and/or modify it under the terms of the MIT License; see LICENSE file for
# more details.

# TODO: Generate this manifest file by running the following commands:
# Generate this manifest file by running the following commands:
# (please sort the lines in this file after running below commands)
#
# git init
# git add -A
# pip install -e .[all]
# check-manifest -u

# added by check-manifest
include *.rst
include *.sh
include .dockerignore
include .editorconfig
include .tx/config
include babel.ini
prune docs/_build
recursive-include .github/workflows *.yml
recursive-include invenio_previewer_geospatial/translations *.po *.pot *.mo

# added by check-manifest
include *.rst
include *.sh
include babel.ini
recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile
recursive-include invenio_previewer_geospatial *.html
recursive-include invenio_previewer_geospatial/translations *.po *.pot *.mo
recursive-include tests *.py
2 changes: 0 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,5 @@

Provides previewers for geospatial file formats

TODO: Please provide feature overview of module

Further documentation is available on
https://invenio-previewer-geospatial.readthedocs.io/
6 changes: 0 additions & 6 deletions invenio_previewer_geospatial/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,5 @@

"""Provides previewers for geospatial file formats."""

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

PREVIEWER_GEOSPATIAL_DEFAULT_VALUE = "foobar"
"""Default value for the application."""

PREVIEWER_GEOSPATIAL_BASE_TEMPLATE = "invenio_previewer_geospatial/base.html"
"""Default base template for the demo page."""
4 changes: 0 additions & 4 deletions invenio_previewer_geospatial/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ class InvenioPreviewerGeospatial(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 Down

This file was deleted.

12 changes: 0 additions & 12 deletions invenio_previewer_geospatial/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

"""Provides previewers for geospatial file formats."""

# 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 invenio_i18n import gettext as _

Expand All @@ -20,12 +17,3 @@
template_folder="templates",
static_folder="static",
)


@blueprint.route("/")
def index():
"""Render a basic view."""
return render_template(
"invenio_previewer_geospatial/index.html",
module_name=_("Invenio-Previewer-Geospatial"),
)
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


# Usage:
# env DB=postgresql12 SEARCH=opensearch2 CACHE=redis MQ=rabbitmq ./run-tests.sh
# ./run-tests.sh

# Quit on errors
set -o errexit
Expand Down
21 changes: 2 additions & 19 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name = invenio-previewer-geospatial
version = attr: invenio_previewer_geospatial.__version__
description = Provides previewers for geospatial file formats
long_description = file: README.rst, CHANGES.rst
keywords = invenio TODO
keywords = invenio previewer geospatial
license = MIT
author = NYU Digital Library Technology Services
author_email = [email protected]
Expand All @@ -36,13 +36,6 @@ tests =
pytest-invenio>=2.1.0,<3.0.0
pytest-black-ng>=0.4.0
sphinx>=4.5.0
# TODO: Check if the module uses search
elasticsearch7 =
invenio-search[elasticsearch7]>=2.1.0,<3.0.0
opensearch1 =
invenio-search[opensearch1]>=2.1.0,<3.0.0
opensearch2 =
invenio-search[opensearch2]>=2.1.0,<3.0.0

[options.entry_points]
invenio_base.apps =
Expand All @@ -51,16 +44,6 @@ invenio_base.blueprints =
invenio_previewer_geospatial = invenio_previewer_geospatial.views:blueprint
invenio_i18n.translations =
messages = invenio_previewer_geospatial
# TODO: Edit these entry points to fit your needs.
# invenio_access.actions =
# invenio_admin.actions =
# invenio_assets.webpack =
# invenio_base.api_apps =
# invenio_base.api_blueprints =
# invenio_celery.tasks =
# invenio_db.models =
# invenio_pidstore.minters =
# invenio_records.jsonresolver =

[build_sphinx]
source-dir = docs/
Expand All @@ -74,7 +57,7 @@ universal = 1
add_ignore = D401,D403

[isort]
profile=black
profile = black

[check-manifest]
ignore =
Expand Down
2 changes: 0 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
@pytest.fixture(scope="module")
def app_config(app_config):
"""Application config override."""
# TODO: Override any necessary config values for tests
app_config["PREVIEWER_GEOSPATIAL_DEFAULT_VALUE"] = "test-foobar"
return app_config


Expand Down
7 changes: 0 additions & 7 deletions tests/test_invenio_previewer_geospatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,3 @@ def test_init():
assert "invenio-previewer-geospatial" not in app.extensions
ext.init_app(app)
assert "invenio-previewer-geospatial" in app.extensions


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

0 comments on commit 8be8857

Please sign in to comment.