From 7919bfd8cf44e4fb50a3ccbd82b725db34b66a08 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Tue, 16 Nov 2021 09:55:58 -0500 Subject: Support Python 3.10 Fixes #1124. --- .github/workflows/tox.yml | 14 ++++++++------ docs/change_log/index.md | 1 + markdown/util.py | 8 ++++---- setup.py | 3 ++- tox.ini | 2 +- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index e7e8afc..18306f7 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -20,20 +20,22 @@ jobs: fail-fast: false max-parallel: 4 matrix: - tox-env: [py36, py37, py38, py39, pypy3, pygments] + tox-env: [py36, py37, py38, py39, py310, pypy3, pygments] include: - tox-env: py36 - python-version: 3.6 + python-version: '3.6' - tox-env: py37 - python-version: 3.7 + python-version: '3.7' - tox-env: py38 - python-version: 3.8 + python-version: '3.8' - tox-env: py39 - python-version: 3.9 + python-version: '3.9' + - tox-env: py310 + python-version: '3.10' - tox-env: pypy3 python-version: pypy3 - tox-env: pygments - python-version: 3.7 + python-version: '3.7' env: TOXENV: ${{ matrix.tox-env }} diff --git a/docs/change_log/index.md b/docs/change_log/index.md index 9700832..cec78ab 100644 --- a/docs/change_log/index.md +++ b/docs/change_log/index.md @@ -11,6 +11,7 @@ Under development: version 3.3.5 (a bug-fix release). * Don't process shebangs in fenced code blocks when using CodeHilite (#1156). * Improve email address validation for Automatic Links (#1165). * Ensure `` tags are parsed correctly (#1079). +* Support Python 3.10 (#1124). Feb 24, 2021: version 3.3.4 (a bug-fix release). diff --git a/markdown/util.py b/markdown/util.py index b443e37..98cfbf7 100644 --- a/markdown/util.py +++ b/markdown/util.py @@ -29,10 +29,10 @@ from itertools import count from .pep562 import Pep562 -try: +if sys.version_info >= (3, 10): from importlib import metadata -except ImportError: - # ='4.4';python_version<'3.10'"], extras_require={ 'testing': [ 'coverage', @@ -117,6 +117,7 @@ setup( 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3 :: Only', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', diff --git a/tox.ini b/tox.ini index 851826a..62523f9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36, py37, py38, py39, pypy3, pygments, flake8, checkspelling, pep517check, checklinks +envlist = py36, py37, py38, py39, py310, pypy3, pygments, flake8, checkspelling, pep517check, checklinks isolated_build = True [testenv] -- cgit v1.2.1