From 99365de66946f31e9bc85d4073b56de8016c638b Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Sun, 21 Feb 2021 23:06:21 +0100 Subject: [PATCH 1/3] upgrading code for python 3.x closes #38 --- .github/workflows/python-app.yml | 2 +- setup.py | 11 +++++++---- tests/test_escaping.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 41240f8..de87672 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -23,7 +23,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8==2.5.4 pytest + pip install flake8==3.8.4 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Lint with flake8 run: | diff --git a/setup.py b/setup.py index 498879d..9488cd2 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ class LintCommand(Command): yield "%s.py" % filename def run(self): - from flake8.engine import get_style_guide + from flake8.api.legacy import get_style_guide flake8_style = get_style_guide(config_file='setup.cfg') paths = self.distribution_files() report = flake8_style.check_files(paths) @@ -70,13 +70,13 @@ setup( zip_safe=False, include_package_data=True, setup_requires=[ - 'flake8', + 'flake8>=3.8,<4', ], tests_require=[ - 'pytest', + 'pytest>=6.2,<7', ], install_requires=[ - 'beautifulsoup4', 'six' + 'beautifulsoup4>=4.9,<5', 'six>=1.15,<2' ], classifiers=[ 'Environment :: Web Environment', @@ -87,6 +87,9 @@ setup( 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Utilities' ], cmdclass={ diff --git a/tests/test_escaping.py b/tests/test_escaping.py index 9b0d4fa..23a828c 100644 --- a/tests/test_escaping.py +++ b/tests/test_escaping.py @@ -2,7 +2,7 @@ from markdownify import markdownify as md def test_underscore(): - assert md('_hey_dude_') == '\_hey\_dude\_' + assert md('_hey_dude_') == r'\_hey\_dude\_' def test_xml_entities(): From fd293a9714f41d470f0cd767401ee194225ea13c Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Sun, 21 Feb 2021 23:08:49 +0100 Subject: [PATCH 2/3] use python 3.8 instead of 3.6 --- .github/workflows/python-app.yml | 4 ++-- .github/workflows/python-publish.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index de87672..000c0b2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.6 + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: 3.8 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1a03a7b..9e3a349 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.x' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip From a59e4b9f48c87bf2633b02bba9d46869c5355613 Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Sun, 21 Feb 2021 23:09:44 +0100 Subject: [PATCH 3/3] bump to v0.6.5 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9488cd2..848f8bc 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() pkgmeta = { '__title__': 'markdownify', '__author__': 'Matthew Tretter', - '__version__': '0.6.4', + '__version__': '0.6.5', }