diff --git a/.circleci/config.yml b/.circleci/config.yml index 67cd829..09d8850 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,7 +1,7 @@ version: 2.1 orbs: - psyplot: psyplot/psyplot-ci-orb@1.5.29 + psyplot: psyplot/psyplot-ci-orb@1.5.31 mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0 executors: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 499da4c..17b0708 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,14 @@ +v1.4.2 +====== +Fix for compatibility with python 3.7 + +Changed +------- +- plugin entrypoint compatibility fix for python 3.7 (`#47 `__) +- ignore SNF links in linkcheck (`#49 `__) +- Replace gitter with mattermost (`#45 `__) + + v1.4.1 ====== Compatibility fixes and minor improvements diff --git a/README.rst b/README.rst index 5d4ae07..59ffbd0 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ The psyplot interactive visualization framework * - implementations - |supported-versions| |supported-implementations| * - get in touch - - |gitter| |mailing-list| |issues| + - |mattermost| |mailing-list| |issues| .. |docs| image:: https://img.shields.io/github/deployments/psyplot/psyplot/github-pages :alt: Documentation @@ -63,9 +63,9 @@ The psyplot interactive visualization framework :target: https://github.com/psyplot/psyplot/releases/latest :alt: Latest github release -.. |gitter| image:: https://img.shields.io/gitter/room/psyplot/community.svg?style=flat - :target: https://gitter.im/psyplot/community - :alt: Gitter +.. |mattermost| image:: https://img.shields.io/badge/chat-on%20mattermost-success?logo=mattermost + :target: https://mattermost.hzdr.de/psyplot/ + :alt: Mattermost .. |mailing-list| image:: https://img.shields.io/badge/join-mailing%20list-brightgreen.svg?style=flat :target: https://www.listserv.dfn.de/sympa/subscribe/psyplot @@ -106,7 +106,7 @@ Get in touch Any quesions? Do not hessitate to get in touch with the psyplot developers. - Create an issue at the `bug tracker`_ -- Chat with the developers in out `channel on gitter`_ +- Chat with the developers in out `team on mattermost`_ - Subscribe to the `mailing list`_ and ask for support - Sent a mail to psyplot@hzg.de @@ -114,7 +114,7 @@ See also the `code of conduct`_, and our `contribution guide`_ for more information and a guide about good bug reports. .. _bug tracker: https://github.com/psyplot/psyplot -.. _channel on gitter: https://gitter.im/psyplot/community +.. _team on mattermost: https://mattermost.hzdr.de/psyplot/ .. _mailing list: https://www.listserv.dfn.de/sympa/subscribe/psyplot .. _code of conduct: https://github.com/psyplot/psyplot/blob/master/CODE_OF_CONDUCT.md .. _contribution guide: https://github.com/psyplot/psyplot/blob/master/CONTRIBUTING.md diff --git a/docs/conf.py b/docs/conf.py index 2ee6d9e..345dd3f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -94,6 +94,11 @@ linkcheck_anchors_ignore = ["^install$"] +linkcheck_ignore = [ + # HACK: SNF seems to have a temporary problem + r"https://p3.snf.ch/project-\d+", +] + # create the api documentation if not osp.exists(osp.join(osp.dirname(__file__), 'api')): spr.check_call(['bash', 'apigen.bash']) diff --git a/docs/index.rst b/docs/index.rst index a22258c..4fd85d4 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,7 +54,7 @@ on `GitHub `__. * - implementations - |supported-versions| |supported-implementations| * - get in touch - - |gitter| |mailing-list| |issues| + - |mattermost| |mailing-list| |issues| .. |docs| image:: https://img.shields.io/github/deployments/psyplot/psyplot/github-pages :alt: Documentation @@ -100,9 +100,9 @@ on `GitHub `__. :target: https://github.com/psyplot/psyplot/releases/latest :alt: Latest github release - .. |gitter| image:: https://img.shields.io/gitter/room/psyplot/community.svg?style=flat - :target: https://gitter.im/psyplot/community - :alt: Gitter + .. |mattermost| image:: https://img.shields.io/badge/chat-on%20mattermost-success?logo=mattermost + :target: https://mattermost.hzdr.de/psyplot/ + :alt: Mattermost .. |mailing-list| image:: https://img.shields.io/badge/join-mailing%20list-brightgreen.svg?style=flat :target: https://www.listserv.dfn.de/sympa/subscribe/psyplot @@ -142,7 +142,7 @@ Get in touch Any quesions? Do not hessitate to get in touch with the psyplot developers. - Create an issue at the `bug tracker`_ -- Chat with the developers in out `channel on gitter`_ +- Chat with the developers in out `team on mattermost`_ - Subscribe to the `mailing list`_ and ask for support See also the `code of conduct`, and our @@ -150,7 +150,7 @@ See also the `code of conduct`, and our about good bug reports. .. _bug tracker: https://github.com/psyplot/psyplot -.. _channel on gitter: https://gitter.im/psyplot/community +.. _team on mattermost: https://mattermost.hzdr.de/psyplot/ .. _mailing list: https://www.listserv.dfn.de/sympa/subscribe/psyplot .. _code of conduct: https://github.com/psyplot/psyplot/blob/master/CODE_OF_CONDUCT.md .. _contribution guide: https://github.com/psyplot/psyplot/blob/master/CONTRIBUTING.md diff --git a/psyplot/__init__.py b/psyplot/__init__.py index 7f40203..c129bd5 100755 --- a/psyplot/__init__.py +++ b/psyplot/__init__.py @@ -123,14 +123,10 @@ def get_versions(requirements=True, key=None): } } """ - from importlib.metadata import entry_points - ret = {'psyplot': _get_versions(requirements)} + from psyplot.utils import plugin_entrypoints + eps = plugin_entrypoints("psyplot", "plugin") - try: - eps = entry_points(group='psyplot', name='plugin') - except TypeError: # python<3.10 - eps = [ep for ep in entry_points().get('psyplot', []) - if ep.name == 'plugin'] + ret = {'psyplot': _get_versions(requirements)} for ep in eps: if str(ep) in rcParams._plugins: logger.debug('Loading entrypoint %s', ep) diff --git a/psyplot/config/rcsetup.py b/psyplot/config/rcsetup.py index cfacfd5..8124674 100755 --- a/psyplot/config/rcsetup.py +++ b/psyplot/config/rcsetup.py @@ -757,14 +757,17 @@ def _load_plugin_entrypoints(self): ------ importlib.metadata.EntryPoint The entry point for the psyplot plugin module""" - from importlib.metadata import entry_points + from psyplot.utils import plugin_entrypoints def load_plugin(ep): try: ep.module except AttributeError: # python<3.10 - ep.module = ep.pattern.match(ep.value).group("module") + try: + ep.module = ep.pattern.match(ep.value).group("module") + except AttributeError: # python<3.8 + ep.module = ep.module_name if plugins_env == ['no']: return False @@ -782,11 +785,7 @@ def load_plugin(ep): logger = logging.getLogger(__name__) - try: - eps = entry_points(group='psyplot', name='plugin') - except TypeError: # python<3.10 - eps = [ep for ep in entry_points().get('psyplot', []) - if ep.name == 'plugin'] + eps = plugin_entrypoints("psyplot", "plugin") for ep in eps: if not load_plugin(ep): logger.debug('Skipping entrypoint %s', ep) diff --git a/psyplot/utils.py b/psyplot/utils.py index b10f66e..b508d6f 100644 --- a/psyplot/utils.py +++ b/psyplot/utils.py @@ -23,6 +23,7 @@ # You should have received a copy of the GNU LGPL-3.0 license # along with this program. If not, see . +import sys import re import six from difflib import get_close_matches @@ -31,6 +32,21 @@ from psyplot.docstring import dedent, docstrings +def plugin_entrypoints(group="psyplot", name="name"): + """This utility function gets the entry points of the psyplot plugins""" + if sys.version_info[:2] > (3, 7): + from importlib.metadata import entry_points + try: + eps = entry_points(group=group, name=name) + except TypeError: # python<3.10 + eps = [ep for ep in entry_points().get(group, []) + if ep.name == name] + else: + from pkg_resources import iter_entry_points + eps = iter_entry_points(group=group, name=name) + return eps + + class DefaultOrderedDict(OrderedDict): """An ordered :class:`collections.defaultdict`