Skip to content

Commit 5e62dfc

Browse files
authored
[semver:patch] plugin entrypoint compatibility fix for python 3.7 (psyplot#50)
Fix for compatibility with python 3.7 (psyplot#50) Changed ------ * plugin entrypoint compatibility fix for python 3.7 (psyplot#47) * ignore SNF links in linkcheck (psyplot#49) * Replace gitter (psyplot#45)
1 parent 6204526 commit 5e62dfc

8 files changed

Lines changed: 54 additions & 27 deletions

File tree

‎.circleci/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
psyplot: psyplot/psyplot-ci-orb@1.5.29
4+
psyplot: psyplot/psyplot-ci-orb@1.5.31
55
mattermost-plugin-notify: nathanaelhoun/mattermost-plugin-notify@1.2.0
66

77
executors:

‎CHANGELOG.rst‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
v1.4.2
2+
======
3+
Fix for compatibility with python 3.7
4+
5+
Changed
6+
-------
7+
- plugin entrypoint compatibility fix for python 3.7 (`#47 <https://github.com/psyplot/psyplot/pull/47>`__)
8+
- ignore SNF links in linkcheck (`#49 <https://github.com/psyplot/psyplot/pull/49>`__)
9+
- Replace gitter with mattermost (`#45 <https://github.com/psyplot/psyplot/pull/45>`__)
10+
11+
112
v1.4.1
213
======
314
Compatibility fixes and minor improvements

‎README.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The psyplot interactive visualization framework
1717
* - implementations
1818
- |supported-versions| |supported-implementations|
1919
* - get in touch
20-
- |gitter| |mailing-list| |issues|
20+
- |mattermost| |mailing-list| |issues|
2121

2222
.. |docs| image:: https://img.shields.io/github/deployments/psyplot/psyplot/github-pages
2323
:alt: Documentation
@@ -63,9 +63,9 @@ The psyplot interactive visualization framework
6363
:target: https://github.com/psyplot/psyplot/releases/latest
6464
:alt: Latest github release
6565

66-
.. |gitter| image:: https://img.shields.io/gitter/room/psyplot/community.svg?style=flat
67-
:target: https://gitter.im/psyplot/community
68-
:alt: Gitter
66+
.. |mattermost| image:: https://img.shields.io/badge/chat-on%20mattermost-success?logo=mattermost
67+
:target: https://mattermost.hzdr.de/psyplot/
68+
:alt: Mattermost
6969

7070
.. |mailing-list| image:: https://img.shields.io/badge/join-mailing%20list-brightgreen.svg?style=flat
7171
:target: https://www.listserv.dfn.de/sympa/subscribe/psyplot
@@ -106,15 +106,15 @@ Get in touch
106106
Any quesions? Do not hessitate to get in touch with the psyplot developers.
107107

108108
- Create an issue at the `bug tracker`_
109-
- Chat with the developers in out `channel on gitter`_
109+
- Chat with the developers in out `team on mattermost`_
110110
- Subscribe to the `mailing list`_ and ask for support
111111
- Sent a mail to psyplot@hzg.de
112112

113113
See also the `code of conduct`_, and our `contribution guide`_ for more
114114
information and a guide about good bug reports.
115115

116116
.. _bug tracker: https://github.com/psyplot/psyplot
117-
.. _channel on gitter: https://gitter.im/psyplot/community
117+
.. _team on mattermost: https://mattermost.hzdr.de/psyplot/
118118
.. _mailing list: https://www.listserv.dfn.de/sympa/subscribe/psyplot
119119
.. _code of conduct: https://github.com/psyplot/psyplot/blob/master/CODE_OF_CONDUCT.md
120120
.. _contribution guide: https://github.com/psyplot/psyplot/blob/master/CONTRIBUTING.md

‎docs/conf.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@
9494

9595
linkcheck_anchors_ignore = ["^install$"]
9696

97+
linkcheck_ignore = [
98+
# HACK: SNF seems to have a temporary problem
99+
r"https://p3.snf.ch/project-\d+",
100+
]
101+
97102
# create the api documentation
98103
if not osp.exists(osp.join(osp.dirname(__file__), 'api')):
99104
spr.check_call(['bash', 'apigen.bash'])

‎docs/index.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ on `GitHub <https://github.com/psyplot/psyplot>`__.
5454
* - implementations
5555
- |supported-versions| |supported-implementations|
5656
* - get in touch
57-
- |gitter| |mailing-list| |issues|
57+
- |mattermost| |mailing-list| |issues|
5858

5959
.. |docs| image:: https://img.shields.io/github/deployments/psyplot/psyplot/github-pages
6060
:alt: Documentation
@@ -100,9 +100,9 @@ on `GitHub <https://github.com/psyplot/psyplot>`__.
100100
:target: https://github.com/psyplot/psyplot/releases/latest
101101
:alt: Latest github release
102102

103-
.. |gitter| image:: https://img.shields.io/gitter/room/psyplot/community.svg?style=flat
104-
:target: https://gitter.im/psyplot/community
105-
:alt: Gitter
103+
.. |mattermost| image:: https://img.shields.io/badge/chat-on%20mattermost-success?logo=mattermost
104+
:target: https://mattermost.hzdr.de/psyplot/
105+
:alt: Mattermost
106106

107107
.. |mailing-list| image:: https://img.shields.io/badge/join-mailing%20list-brightgreen.svg?style=flat
108108
:target: https://www.listserv.dfn.de/sympa/subscribe/psyplot
@@ -142,15 +142,15 @@ Get in touch
142142
Any quesions? Do not hessitate to get in touch with the psyplot developers.
143143

144144
- Create an issue at the `bug tracker`_
145-
- Chat with the developers in out `channel on gitter`_
145+
- Chat with the developers in out `team on mattermost`_
146146
- Subscribe to the `mailing list`_ and ask for support
147147

148148
See also the `code of conduct`, and our
149149
:ref:`contribution guide <how-to-contribute>` for more information and a guide
150150
about good bug reports.
151151

152152
.. _bug tracker: https://github.com/psyplot/psyplot
153-
.. _channel on gitter: https://gitter.im/psyplot/community
153+
.. _team on mattermost: https://mattermost.hzdr.de/psyplot/
154154
.. _mailing list: https://www.listserv.dfn.de/sympa/subscribe/psyplot
155155
.. _code of conduct: https://github.com/psyplot/psyplot/blob/master/CODE_OF_CONDUCT.md
156156
.. _contribution guide: https://github.com/psyplot/psyplot/blob/master/CONTRIBUTING.md

‎psyplot/__init__.py‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,10 @@ def get_versions(requirements=True, key=None):
123123
}
124124
}
125125
"""
126-
from importlib.metadata import entry_points
127-
ret = {'psyplot': _get_versions(requirements)}
126+
from psyplot.utils import plugin_entrypoints
127+
eps = plugin_entrypoints("psyplot", "plugin")
128128

129-
try:
130-
eps = entry_points(group='psyplot', name='plugin')
131-
except TypeError: # python<3.10
132-
eps = [ep for ep in entry_points().get('psyplot', [])
133-
if ep.name == 'plugin']
129+
ret = {'psyplot': _get_versions(requirements)}
134130
for ep in eps:
135131
if str(ep) in rcParams._plugins:
136132
logger.debug('Loading entrypoint %s', ep)

‎psyplot/config/rcsetup.py‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -757,14 +757,17 @@ def _load_plugin_entrypoints(self):
757757
------
758758
importlib.metadata.EntryPoint
759759
The entry point for the psyplot plugin module"""
760-
from importlib.metadata import entry_points
760+
from psyplot.utils import plugin_entrypoints
761761

762762
def load_plugin(ep):
763763

764764
try:
765765
ep.module
766766
except AttributeError: # python<3.10
767-
ep.module = ep.pattern.match(ep.value).group("module")
767+
try:
768+
ep.module = ep.pattern.match(ep.value).group("module")
769+
except AttributeError: # python<3.8
770+
ep.module = ep.module_name
768771

769772
if plugins_env == ['no']:
770773
return False
@@ -782,11 +785,7 @@ def load_plugin(ep):
782785

783786
logger = logging.getLogger(__name__)
784787

785-
try:
786-
eps = entry_points(group='psyplot', name='plugin')
787-
except TypeError: # python<3.10
788-
eps = [ep for ep in entry_points().get('psyplot', [])
789-
if ep.name == 'plugin']
788+
eps = plugin_entrypoints("psyplot", "plugin")
790789
for ep in eps:
791790
if not load_plugin(ep):
792791
logger.debug('Skipping entrypoint %s', ep)

‎psyplot/utils.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
# You should have received a copy of the GNU LGPL-3.0 license
2424
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2525

26+
import sys
2627
import re
2728
import six
2829
from difflib import get_close_matches
@@ -31,6 +32,21 @@
3132
from psyplot.docstring import dedent, docstrings
3233

3334

35+
def plugin_entrypoints(group="psyplot", name="name"):
36+
"""This utility function gets the entry points of the psyplot plugins"""
37+
if sys.version_info[:2] > (3, 7):
38+
from importlib.metadata import entry_points
39+
try:
40+
eps = entry_points(group=group, name=name)
41+
except TypeError: # python<3.10
42+
eps = [ep for ep in entry_points().get(group, [])
43+
if ep.name == name]
44+
else:
45+
from pkg_resources import iter_entry_points
46+
eps = iter_entry_points(group=group, name=name)
47+
return eps
48+
49+
3450
class DefaultOrderedDict(OrderedDict):
3551
"""An ordered :class:`collections.defaultdict`
3652

0 commit comments

Comments
 (0)