Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
psyplot: psyplot/[email protected].29
psyplot: psyplot/[email protected].31
mattermost-plugin-notify: nathanaelhoun/[email protected]

executors:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
v1.4.2
======
Fix for compatibility with python 3.7

Changed
-------
- plugin entrypoint compatibility fix for python 3.7 (`#47 <https://github.com/psyplot/psyplot/pull/47>`__)
- ignore SNF links in linkcheck (`#49 <https://github.com/psyplot/psyplot/pull/49>`__)
- Replace gitter with mattermost (`#45 <https://github.com/psyplot/psyplot/pull/45>`__)


v1.4.1
======
Compatibility fixes and minor improvements
Expand Down
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -106,15 +106,15 @@ 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 [email protected]

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
Expand Down
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
12 changes: 6 additions & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ on `GitHub <https://github.com/psyplot/psyplot>`__.
* - 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
Expand Down Expand Up @@ -100,9 +100,9 @@ on `GitHub <https://github.com/psyplot/psyplot>`__.
: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
Expand Down Expand Up @@ -142,15 +142,15 @@ 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
:ref:`contribution guide <how-to-contribute>` 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
Expand Down
10 changes: 3 additions & 7 deletions psyplot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 6 additions & 7 deletions psyplot/config/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions psyplot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# You should have received a copy of the GNU LGPL-3.0 license
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import sys
import re
import six
from difflib import get_close_matches
Expand All @@ -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`

Expand Down