Skip to content

Commit 7919bfd

Browse files
authored
Support Python 3.10
Fixes #1124.
1 parent d1ed480 commit 7919bfd

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

.github/workflows/tox.yml

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,22 @@ jobs:
2020
fail-fast: false
2121
max-parallel: 4
2222
matrix:
23-
tox-env: [py36, py37, py38, py39, pypy3, pygments]
23+
tox-env: [py36, py37, py38, py39, py310, pypy3, pygments]
2424
include:
2525
- tox-env: py36
26-
python-version: 3.6
26+
python-version: '3.6'
2727
- tox-env: py37
28-
python-version: 3.7
28+
python-version: '3.7'
2929
- tox-env: py38
30-
python-version: 3.8
30+
python-version: '3.8'
3131
- tox-env: py39
32-
python-version: 3.9
32+
python-version: '3.9'
33+
- tox-env: py310
34+
python-version: '3.10'
3335
- tox-env: pypy3
3436
python-version: pypy3
3537
- tox-env: pygments
36-
python-version: 3.7
38+
python-version: '3.7'
3739

3840
env:
3941
TOXENV: ${{ matrix.tox-env }}

docs/change_log/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Under development: version 3.3.5 (a bug-fix release).
1111
* Don't process shebangs in fenced code blocks when using CodeHilite (#1156).
1212
* Improve email address validation for Automatic Links (#1165).
1313
* Ensure `<summary>` tags are parsed correctly (#1079).
14+
* Support Python 3.10 (#1124).
1415

1516
Feb 24, 2021: version 3.3.4 (a bug-fix release).
1617

markdown/util.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929

3030
from .pep562 import Pep562
3131

32-
try:
32+
if sys.version_info >= (3, 10):
3333
from importlib import metadata
34-
except ImportError:
35-
# <PY38 use backport
34+
else:
35+
# <PY310 use backport
3636
import importlib_metadata as metadata
3737

3838
PY37 = (3, 7) <= sys.version_info
@@ -85,7 +85,7 @@
8585
"""
8686

8787
# Only load extension entry_points once.
88-
INSTALLED_EXTENSIONS = metadata.entry_points().get('markdown.extensions', ())
88+
INSTALLED_EXTENSIONS = metadata.entry_points(group='markdown.extensions')
8989
RTL_BIDI_RANGES = (
9090
('\u0590', '\u07FF'),
9191
# Hebrew (0590-05FF), Arabic (0600-06FF),

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_version():
7474
license='BSD License',
7575
packages=['markdown', 'markdown.extensions'],
7676
python_requires='>=3.6',
77-
install_requires=["importlib-metadata;python_version<'3.8'"],
77+
install_requires=["importlib-metadata>='4.4';python_version<'3.10'"],
7878
extras_require={
7979
'testing': [
8080
'coverage',
@@ -117,6 +117,7 @@ def get_version():
117117
'Programming Language :: Python :: 3.7',
118118
'Programming Language :: Python :: 3.8',
119119
'Programming Language :: Python :: 3.9',
120+
'Programming Language :: Python :: 3.10',
120121
'Programming Language :: Python :: 3 :: Only',
121122
'Programming Language :: Python :: Implementation :: CPython',
122123
'Programming Language :: Python :: Implementation :: PyPy',

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36, py37, py38, py39, pypy3, pygments, flake8, checkspelling, pep517check, checklinks
2+
envlist = py36, py37, py38, py39, py310, pypy3, pygments, flake8, checkspelling, pep517check, checklinks
33
isolated_build = True
44

55
[testenv]

0 commit comments

Comments
 (0)