From cde6906489c570fd3912ed0a1a6e21ae058348f7 Mon Sep 17 00:00:00 2001 From: marcusatiliusregulus Date: Fri, 10 Sep 2021 19:03:41 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9A=20DOCS:=20Fix=20parameter-name?= =?UTF-8?q?s=20and=20descriptions=20(#173)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this corrects the docstrings of some of class Ruler's methods --- markdown_it/ruler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/markdown_it/ruler.py b/markdown_it/ruler.py index 9f40fbb7..997c95dc 100644 --- a/markdown_it/ruler.py +++ b/markdown_it/ruler.py @@ -103,7 +103,7 @@ def __compile__(self) -> None: def at(self, ruleName: str, fn: RuleFunc, options=None): """Replace rule by name with new function & options. - :param name: rule name to replace. + :param ruleName: rule name to replace. :param fn: new rule function. :param options: new rule options (not mandatory). :raises: KeyError if name not found @@ -135,8 +135,8 @@ def before(self, beforeName: str, ruleName: str, fn: RuleFunc, options=None): def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None): """Add new rule to chain after one with given name. - :param beforeName: new rule will be added before this one. - :param ruleName: new rule will be added before this one. + :param afterName: new rule will be added after this one. + :param ruleName: new rule will be added after this one. :param fn: new rule function. :param options: new rule options (not mandatory). :raises: KeyError if name not found @@ -153,7 +153,7 @@ def after(self, afterName: str, ruleName: str, fn: RuleFunc, options=None): def push(self, ruleName: str, fn: RuleFunc, options=None): """Push new rule to the end of chain. - :param ruleName: new rule will be added before this one. + :param ruleName: new rule will be added to the end of chain. :param fn: new rule function. :param options: new rule options (not mandatory). From facd5484b14bfbf52973e1e629e3db3420b48a4b Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:15:31 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=A7=AA=20TESTS:=20Test=20against=20py?= =?UTF-8?q?thon3.10=20(#178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tests.yml | 14 +++++++------- setup.cfg | 9 ++++++--- tox.ini | 10 +++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e350953..b1e1e3f4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.8' - uses: pre-commit/action@v2.0.0 tests: @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [pypy-3.6, 3.6, 3.7, 3.8, 3.9] + python-version: ['pypy-3.6', '3.6', '3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 @@ -45,9 +45,9 @@ jobs: pip install .[testing,linkify] - name: Run pytest run: | - pytest --cov=markdown_it --cov-report=xml --cov-report=term-missing + pytest tests/ --cov=markdown_it --cov-report=xml --cov-report=term-missing - name: Upload to Codecov - if: matrix.python-version == 3.7 && github.repository == 'executablebooks/markdown-it-py' + if: matrix.python-version == '3.7' && github.repository == 'executablebooks/markdown-it-py' uses: codecov/codecov-action@v1 with: name: markdown-it-py-pytests-py3.7 @@ -60,7 +60,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: ['3.8'] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -87,7 +87,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.8' - name: Install tox run: | @@ -116,7 +116,7 @@ jobs: - name: Set up Python 3.7 uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: '3.7' - name: Build package run: | pip install wheel diff --git a/setup.cfg b/setup.cfg index f7647166..de38dd95 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Libraries :: Python Modules @@ -61,11 +62,13 @@ rtd = sphinx_book_theme testing = coverage - psutil - pytest>=3.6,<4 - pytest-benchmark~=3.2 + pytest pytest-cov pytest-regressions +benchmarking = + psutil + pytest + pytest-benchmark~=3.2 [options.packages.find] exclude = diff --git a/tox.ini b/tox.ini index 8b85b395..ff57b2a2 100644 --- a/tox.ini +++ b/tox.ini @@ -9,13 +9,13 @@ envlist = py37 [testenv] usedevelop = true -[testenv:py{36,37,38,39}] +[testenv:py{36,37,38,39,310}] extras = linkify testing -commands = pytest {posargs} +commands = pytest tests/ {posargs} -[testenv:py{36,37,38,39}-plugins] +[testenv:py{36,37,38,39,310}-plugins] extras = testing changedir = {envtmpdir} allowlist_externals = @@ -28,11 +28,11 @@ commands = pytest {posargs} [testenv:py{36,37,38,39}-bench-core] -extras = testing +extras = benchmarking commands = pytest benchmarking/bench_core.py {posargs} [testenv:py{36,37,38}-bench-packages] -extras = testing,compare +extras = benchmarking,compare commands = pytest benchmarking/bench_packages.py {posargs} [testenv:docs-{update,clean}] From 0195be38d968c7b263e0cc9b5bc40dcc3464b1a6 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:22:51 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A7=AA=20TESTS:=20Add=20URL=20normali?= =?UTF-8?q?sation=20xfail=20(#170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Chris Sewell --- tests/test_port/fixtures/normalize.md | 8 ++++++++ tests/test_port/test_fixtures.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_port/fixtures/normalize.md b/tests/test_port/fixtures/normalize.md index 0020e16d..4a005089 100644 --- a/tests/test_port/fixtures/normalize.md +++ b/tests/test_port/fixtures/normalize.md @@ -29,3 +29,11 @@ Don't encode domains in unknown schemas: .

. + + +Square brackets are allowed +. +[foo](https://bar]baz.org) +. +

foo

+. diff --git a/tests/test_port/test_fixtures.py b/tests/test_port/test_fixtures.py index 4e0c94d5..5e94a149 100644 --- a/tests/test_port/test_fixtures.py +++ b/tests/test_port/test_fixtures.py @@ -84,7 +84,10 @@ def test_commonmark_extras(line, title, input, expected): read_fixture_file(FIXTURE_PATH.joinpath("normalize.md")), ) def test_normalize_url(line, title, input, expected): - if "Keep %25" in title: + if title in { + "Keep %25 as is because decoding it may break urls, #720", + "Square brackets are allowed", + }: # TODO fix failing url escaping test pytest.xfail("url normalisation") md = MarkdownIt("commonmark")