From 0671993e089c428320e68ca71054d5249263a540 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sat, 30 Nov 2024 05:34:00 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Drop=20Python=203.9,?= =?UTF-8?q?=20test=203.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/benchmark.yml | 4 ++-- .github/workflows/tests.yml | 19 ++++++++++--------- markdown_it/common/utils.py | 3 ++- markdown_it/utils.py | 3 ++- pyproject.toml | 8 ++++---- tox.ini | 10 +++++----- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2a6ab8d1..c6f58c67 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: install pandoc uses: r-lib/actions/setup-pandoc@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a4272ffe..b3b0168b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,18 +20,19 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - uses: pre-commit/action@v3.0.0 tests: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: ['pypy-3.8', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['pypy-3.9', '3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 @@ -48,7 +49,7 @@ jobs: run: | pytest tests/ --cov=markdown_it --cov-report=xml --cov-report=term-missing - name: Upload to Codecov - if: matrix.python-version == '3.8' && github.repository == 'executablebooks/markdown-it-py' + if: matrix.python-version == '3.9' && github.repository == 'executablebooks/markdown-it-py' uses: codecov/codecov-action@v3 with: name: markdown-it-py-pytests @@ -62,7 +63,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8'] + python-version: ['3.9'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -86,10 +87,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: Install tox run: | @@ -115,10 +116,10 @@ jobs: steps: - name: Checkout source uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.9' - name: install flit run: | pip install flit~=3.4 diff --git a/markdown_it/common/utils.py b/markdown_it/common/utils.py index 59812a80..fedae7e1 100644 --- a/markdown_it/common/utils.py +++ b/markdown_it/common/utils.py @@ -3,7 +3,8 @@ from __future__ import annotations import re -from typing import Match, TypeVar +from re import Match +from typing import TypeVar from .entities import entities diff --git a/markdown_it/utils.py b/markdown_it/utils.py index a9793720..86cfee7f 100644 --- a/markdown_it/utils.py +++ b/markdown_it/utils.py @@ -1,8 +1,9 @@ from __future__ import annotations +from collections.abc import Iterable, MutableMapping from collections.abc import MutableMapping as MutableMappingABC from pathlib import Path -from typing import Any, Callable, Iterable, MutableMapping, TypedDict, cast +from typing import Any, Callable, TypedDict, cast EnvType = MutableMapping[str, Any] # note: could use TypeAlias in python 3.10 """Type for the environment sandbox used in parsing and rendering, diff --git a/pyproject.toml b/pyproject.toml index 09e696cd..aa13fadf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,18 +14,18 @@ classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup", ] keywords = ["markdown", "lexer", "parser", "commonmark", "markdown-it"] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "mdurl~=0.1", ] diff --git a/tox.ini b/tox.ini index c2915b32..aa56d9db 100644 --- a/tox.ini +++ b/tox.ini @@ -4,18 +4,18 @@ # then run `tox` or `tox -- {pytest args}` # run in parallel using `tox -p` [tox] -envlist = py38 +envlist = py39 [testenv] usedevelop = true -[testenv:py{38,39,310,311,312}] +[testenv:py{39,310,311,312,313}] extras = linkify testing commands = pytest {posargs:tests/} -[testenv:py{38,39,310,311}-plugins] +[testenv:py{39,310,311,312,313}-plugins] extras = testing changedir = {envtmpdir} allowlist_externals = @@ -27,11 +27,11 @@ commands_pre = commands = pytest {posargs} -[testenv:py{38,39,310,311,312}-bench-core] +[testenv:py{39,310,311,312,313}-bench-core] extras = benchmarking commands = pytest benchmarking/bench_core.py {posargs} -[testenv:py{38,39,310,311,312}-bench-packages] +[testenv:py{39,310,311,312,313}-bench-packages] extras = benchmarking,compare commands = pytest benchmarking/bench_packages.py {posargs} From c4ae2f5cca5c26f42caf7cf10d587dc455c5b9fe Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sat, 30 Nov 2024 05:38:03 +0100 Subject: [PATCH 2/3] updates --- .github/workflows/benchmark.yml | 2 +- .github/workflows/tests.yml | 2 +- docs/contributing.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c6f58c67..bfa7ff63 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -27,7 +27,7 @@ jobs: pip install tox - name: Run package benchmarks - run: tox -e py38-bench-packages -- --benchmark-min-rounds 20 --benchmark-json bench-packages.json + run: tox -e py39-bench-packages -- --benchmark-min-rounds 20 --benchmark-json bench-packages.json # - name: Upload package data # uses: actions/upload-artifact@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3b0168b..d0ccc219 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -98,7 +98,7 @@ jobs: pip install tox - name: Run benchmark - run: tox -e py38-bench-core -- --benchmark-json bench-core.json + run: tox -e py39-bench-core -- --benchmark-json bench-core.json - name: Upload data uses: actions/upload-artifact@v3 diff --git a/docs/contributing.md b/docs/contributing.md index 8b46e678..b2302046 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -50,7 +50,7 @@ This can also be used to run benchmarking tests using [pytest-benchmark](https:/ ```shell >> cd markdown-it-py -tox -e py38-bench-packages -- --benchmark-min-rounds 50 +tox -e py39-bench-packages -- --benchmark-min-rounds 50 ``` For documentation build tests: From cb9c8ffef770ee49013e7239e9a8fb9bdc24570d Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sat, 30 Nov 2024 05:43:09 +0100 Subject: [PATCH 3/3] update --- .readthedocs.yml | 2 +- docs/conf.py | 4 ++-- tox.ini | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 57297d4b..5b09f7d1 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.9" python: install: diff --git a/docs/conf.py b/docs/conf.py index ed38bb50..dc1a28fd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,7 +48,7 @@ nitpick_ignore_regex = [ ("py:.*", name) for name in ( - "_ItemTV", + ".*_ItemTV", ".*_NodeType", ".*Literal.*", ".*_Result", @@ -84,7 +84,7 @@ intersphinx_mapping = { - "python": ("https://docs.python.org/3.8", None), + "python": ("https://docs.python.org/3.9", None), "mdit-py-plugins": ("https://mdit-py-plugins.readthedocs.io/en/latest/", None), } diff --git a/tox.ini b/tox.ini index aa56d9db..b17bd9d4 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,7 @@ commands = pytest benchmarking/bench_packages.py {posargs} [testenv:docs-{update,clean}] extras = linkify,plugins,rtd -whitelist_externals = +allowlist_externals = echo rm setenv =