Skip to content

Commit 7b3a23c

Browse files
uniphilwaylan
authored andcommitted
Fix deprecation warnings
For `python-markdown`, this means bumping the minimum supported version to 3.0.0. For system dependencies, it means leaving python2 behind.
1 parent c03e963 commit 7b3a23c

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ matrix:
1010
python: 3.5
1111
- env: TOXENV=py36
1212
python: 3.6
13+
- env: TOXENV=py37
14+
python: 3.7
15+
- env: TOXENV=py38
16+
python: 3.8
17+
- env: TOXENV=py39
18+
python: 3.9
1319
- env: TOXENV=pypy
1420
python: pypy
1521
- env: TOXENV=pypy3

mdx_gh_links.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
from markdown.extensions import Extension
3434
from markdown.inlinepatterns import Pattern
35-
from markdown.util import etree
35+
from xml.etree import ElementTree
3636

3737

3838
URL_BASE = 'https://github.com'
@@ -43,7 +43,7 @@
4343

4444

4545
def _build_link(label, title, href, classes):
46-
el = etree.Element('a')
46+
el = ElementTree.Element('a')
4747
el.text = label
4848
el.set('title', title)
4949
el.set('href', href)
@@ -121,11 +121,11 @@ def __init__(self, *args, **kwargs):
121121
}
122122
super(GithubLinks, self).__init__(*args, **kwargs)
123123

124-
def extendMarkdown(self, md, md_globals):
124+
def extendMarkdown(self, md):
125125
md.ESCAPED_CHARS.append('@')
126-
md.inlinePatterns['issue'] = IssuePattern(self.getConfigs(), md)
127-
md.inlinePatterns['mention'] = MentionPattern(self.getConfigs(), md)
128-
md.inlinePatterns['commit'] = CommitPattern(self.getConfigs(), md)
126+
md.inlinePatterns.register(IssuePattern(self.getConfigs(), md), 'issue', 20)
127+
md.inlinePatterns.register(MentionPattern(self.getConfigs(), md), 'mention', 20)
128+
md.inlinePatterns.register(CommitPattern(self.getConfigs(), md), 'commit', 20)
129129

130130

131131
def makeExtension(*args, **kwargs): # pragma: no cover

setup.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,19 @@
4444
url='https://github.com/Python-Markdown/github-links/',
4545
license='BSD License',
4646
py_modules=['mdx_gh_links'],
47-
install_requires=['markdown>=2.6.11'],
47+
install_requires=['markdown>=3.0.0'],
4848
classifiers=[
4949
'Development Status :: 4 - Beta',
5050
'License :: OSI Approved :: BSD License',
5151
'Operating System :: OS Independent',
5252
'Programming Language :: Python',
53-
'Programming Language :: Python :: 2',
54-
'Programming Language :: Python :: 2.7',
5553
'Programming Language :: Python :: 3',
5654
'Programming Language :: Python :: 3.4',
5755
'Programming Language :: Python :: 3.5',
5856
'Programming Language :: Python :: 3.6',
57+
'Programming Language :: Python :: 3.7',
58+
'Programming Language :: Python :: 3.8',
59+
'Programming Language :: Python :: 3.9',
5960
'Programming Language :: Python :: Implementation :: CPython',
6061
'Programming Language :: Python :: Implementation :: PyPy',
6162
'Topic :: Documentation',

0 commit comments

Comments
 (0)