Skip to content

Commit

Permalink
reorganize plugins to simplify import strategy
Browse files Browse the repository at this point in the history
also update travis and setup

travis removed hunspell dependency since pyontutils is not being
installed with the spell option
  • Loading branch information
tgbugs committed Nov 7, 2019
1 parent 036fb72 commit d63a62a
Show file tree
Hide file tree
Showing 13 changed files with 1,198 additions and 1,205 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ branches:

python:
- 3.6

before_install:
- sudo apt-get install hunspell
- sudo apt-get install libhunspell-dev
- 3.7

install:
- pip install --upgrade pytest pytest-cov
Expand All @@ -26,7 +23,7 @@ install:
- pipenv install --dev --system --skip-lock --deploy

script:
- PYTHONWARNINGS=ignore pipenv run pytest --verbose --cov=ontquery
- PYTHONWARNINGS=ignore pipenv run pytest --verbose --color=yes --cov=ontquery

after_success:
- if [[ $HAS_COVERALLS ]] ; then coveralls ; fi
13 changes: 6 additions & 7 deletions ontquery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ def register(name, module_path, class_name):
_plugins[name] = p


register('rdflib', 'ontquery.plugins.services', 'rdflibLocal')
register('InterLex', 'ontquery.plugins.services', 'InterLexRemote')
register('SciGraph', 'ontquery.plugins.services', 'SciGraphRemote')
register('SciCrunch', 'ontquery.plugins.services', 'SciCrunchRemote')
register('GitHub', 'ontquery.plugins.services', 'GitHubRemote')
register('iris', 'ontquery.plugins.services', 'StaticIriRemote')

register('InterLex', 'ontquery.plugins.services.interlex', 'InterLexRemote')
register('SciGraph', 'ontquery.plugins.services.scigraph', 'SciGraphRemote')
register('SciCrunch', 'ontquery.plugins.services.scigraph', 'SciCrunchRemote')
register('rdflib', 'ontquery.plugins.services.rdflib', 'rdflibLocal')
register('iris', 'ontquery.plugins.services.rdflib', 'StaticIriRemote')
register('GitHub', 'ontquery.plugins.services.rdflib', 'GitHubRemote')
17 changes: 0 additions & 17 deletions ontquery/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +0,0 @@
import pathlib

try:
import orthauth as oa
auth = oa.configure(pathlib.Path(__file__).parent / 'auth-config.py')
class deco:
scigraph_api_key = auth.tangential_init('api_key', 'scigraph-api-key')
interlex_api_key = auth.tangential_init('api_key', 'interlex-api-key')
interlex_basic_u = auth.tangential_init('_basic_auth_user', 'interlex-basic-auth-user')
interlex_basic_p = auth.tangential_init('_basic_auth_pass', 'interlex-basic-auth-pass')
except ModuleNotFoundError:
class deco:
scigraph_api_key = lambda cls: cls
interlex_api_key = lambda cls: cls
interlex_basic_u = lambda cls: cls
interlex_basic_p = lambda cls: cls

1,159 changes: 0 additions & 1,159 deletions ontquery/plugins/services.py

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions ontquery/plugins/services/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pathlib
try:
import orthauth as oa
auth = oa.configure(pathlib.Path(__file__).parent / 'auth-config.py')
class deco:
scigraph_api_key = auth.tangential_init('api_key', 'scigraph-api-key')
interlex_api_key = auth.tangential_init('api_key', 'interlex-api-key')
interlex_basic_u = auth.tangential_init('_basic_auth_user', 'interlex-basic-auth-user')
interlex_basic_p = auth.tangential_init('_basic_auth_pass', 'interlex-basic-auth-pass')
except ModuleNotFoundError:
class deco:
scigraph_api_key = lambda cls: cls
interlex_api_key = lambda cls: cls
interlex_basic_u = lambda cls: cls
interlex_basic_p = lambda cls: cls
File renamed without changes.
Loading

0 comments on commit d63a62a

Please sign in to comment.