Skip to content

Officially Support Python 3.10 #1124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dmashine opened this issue Mar 31, 2021 · 4 comments · Fixed by #1193
Closed

Officially Support Python 3.10 #1124

dmashine opened this issue Mar 31, 2021 · 4 comments · Fixed by #1193
Labels
bug Bug report. confirmed Confirmed bug report or approved feature request. core Related to the core parser code.
Milestone

Comments

@dmashine
Copy link

dmashine commented Mar 31, 2021

Hello!
If i run a test with python3 -We error level, i got this Warning:

  File "/usr/local/lib/python3.7/dist-packages/markdown/__init__.py", line 29, in <module>
    from .core import Markdown, markdown, markdownFromFile  # noqa: E402
  File "/usr/local/lib/python3.7/dist-packages/markdown/core.py", line 26, in <module>
    from . import util
  File "/usr/local/lib/python3.7/dist-packages/markdown/util.py", line 87, in <module>
    INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 312, in get
    flake8_bypass(self._warn)()
DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.

python version is Python 3.7.3
see changes in metadata.py

@mitya57
Copy link
Collaborator

mitya57 commented Mar 31, 2021

So instead of

metadata.entry_points().get('markdown.extensions', ())

We are supposed to use

metadata.entry_points(group='markdown.extensions')

The new API is already available in the importlib_metadata backport on PyPI, but it will be included in Python standard library only since version 3.10:
https://docs.python.org/3.10/library/importlib.metadata.html#entry-points

@waylan
Copy link
Member

waylan commented Mar 31, 2021

The new API is already available in the importlib_metadata backport on PyPI, but it will be included in Python standard library only since version 3.10

Note that we are using the backport for Python 3.6 and 3.7. So we only need to address this for 3.8 and 3.9. I suppose we could just require the backport for those as well. We would need to limit the backport to newer versions only which include support for the change.

Regardless, we do not yet officially support Python 3.10, and won't until close in time to its final release, so there is no rush. However, a PR is welcome if someone want's to.

@waylan waylan added bug Bug report. confirmed Confirmed bug report or approved feature request. core Related to the core parser code. labels Mar 31, 2021
@johnthagen
Copy link
Contributor

This warning just started triggering when we added Python 3.10 to our CI matrix. A new release that fixes this would be appreciated.

A stacktrace:

  File "/.tox/docker/lib/python3.10/site-packages/rest_framework/compat.py", line 71, in <module>
    import markdown
  File "/.tox/docker/lib/python3.10/site-packages/markdown/__init__.py", line 29, in <module>
    from .core import Markdown, markdown, markdownFromFile  # noqa: E402
  File "/.tox/docker/lib/python3.10/site-packages/markdown/core.py", line 26, in <module>
    from . import util
  File "/.tox/docker/lib/python3.10/site-packages/markdown/util.py", line 87, in <module>
    INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())
  File "/usr/local/lib/python3.10/importlib/metadata/__init__.py", line 400, in get
    self._warn()
DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.

@waylan waylan added this to the Version 3.3.5 milestone Nov 15, 2021
@waylan
Copy link
Member

waylan commented Nov 15, 2021

As Python 3.10 was released last month, we should officially add support. I've adding this to the 3.3.5 Milestone so we don't forget about it. Of course, a PR is welcome.

@waylan waylan changed the title DeprecationWarning Officially Support Python 3.10 Nov 15, 2021
waylan added a commit to waylan/markdown that referenced this issue Nov 16, 2021
waylan added a commit that referenced this issue Nov 16, 2021
ghickman added a commit to opensafely-core/job-server that referenced this issue Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report. confirmed Confirmed bug report or approved feature request. core Related to the core parser code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants