diff --git a/.codecov.yml b/.codecov.yml index b4a4c79..75bbea5 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -16,6 +16,5 @@ coverage: ignore: - "mapca/tests/" - - "mapca/due.py" - "mapca/_version.py" - "mapca/info.py" diff --git a/mapca/__init__.py b/mapca/__init__.py index 9438a3a..b440fb8 100644 --- a/mapca/__init__.py +++ b/mapca/__init__.py @@ -4,7 +4,6 @@ """ from ._version import get_versions -from .due import Doi, due from .mapca import MovingAveragePCA, ma_pca __version__ = get_versions()["version"] diff --git a/mapca/due.py b/mapca/due.py deleted file mode 100644 index 3f0c76d..0000000 --- a/mapca/due.py +++ /dev/null @@ -1,65 +0,0 @@ -""" -Stub file for a guaranteed safe import of duecredit constructs: if duecredit -is not available. -To use it, place it into your project codebase to be imported, e.g. copy as - cp stub.py /path/tomodule/module/due.py -Note that it might be better to avoid naming it duecredit.py to avoid shadowing -installed duecredit. -Then use in your code as - from .due import due, Doi, BibTeX -See https://github.com/duecredit/duecredit/blob/master/README.md for examples. -Origin: Originally a part of the duecredit -Copyright: 2015-2016 DueCredit developers -License: BSD-2 -""" - -__version__ = "0.0.5" - - -class InactiveDueCreditCollector(object): - """Just a stub at the Collector which would not do anything""" - - def _donothing(self, *args, **kwargs): - """Perform no good and no bad""" - pass - - def dcite(self, *args, **kwargs): - """If I could cite I would""" - - def nondecorating_decorator(func): - return func - - return nondecorating_decorator - - cite = load = add = _donothing - - def __repr__(self): - return self.__class__.__name__ + "()" - - -def _donothing_func(*args, **kwargs): - """Perform no good and no bad""" - pass - - -try: - from duecredit import due, BibTeX, Doi, Url - - if "due" in locals() and not hasattr(due, "cite"): - raise RuntimeError("Imported due lacks .cite. DueCredit is now disabled") -except Exception as e: - if type(e).__name__ != "ImportError": - import logging - - logging.getLogger("duecredit").error("Failed to import duecredit due to %s" % str(e)) - # Initiate due stub - due = InactiveDueCreditCollector() - BibTeX = Doi = Url = _donothing_func - -# Emacs mode definitions -# Local Variables: -# mode: python -# py-indent-offset: 4 -# tab-width: 4 -# indent-tabs-mode: nil -# End: diff --git a/mapca/info.py b/mapca/info.py index d16d619..e993d88 100644 --- a/mapca/info.py +++ b/mapca/info.py @@ -4,10 +4,10 @@ """ Base module variables """ + import importlib.util import json import os.path as op - from pathlib import Path # Get version @@ -82,13 +82,12 @@ "sphinx-argparse", ], "tests": TESTS_REQUIRES, - "duecredit": ["duecredit"], } ENTRY_POINTS = {} # Enable a handle to install all extra dependencies at once -EXTRA_REQUIRES["all"] = list(set([v for deps in EXTRA_REQUIRES.values() for v in deps])) +EXTRA_REQUIRES["all"] = list({v for deps in EXTRA_REQUIRES.values() for v in deps}) # Supported Python versions using PEP 440 version specifiers # Should match the same set of Python versions as classifiers diff --git a/pyproject.toml b/pyproject.toml index aa578e1..ae0466c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,5 @@ exclude = ''' | versioneer.py | mapca/info.py | mapca/_version.py - | mapca/due.py ) ''' \ No newline at end of file