Skip to content

Commit

Permalink
⬆️ Drop Python 3.9, test 3.13 (#342)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Nov 30, 2024
1 parent 21335c8 commit 876c366
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -86,18 +87,18 @@ 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: |
python -m pip install --upgrade pip
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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.9"

python:
install:
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
nitpick_ignore_regex = [
("py:.*", name)
for name in (
"_ItemTV",
".*_ItemTV",
".*_NodeType",
".*Literal.*",
".*_Result",
Expand Down Expand Up @@ -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),
}

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion markdown_it/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion markdown_it/utils.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -27,17 +27,17 @@ 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}

[testenv:docs-{update,clean}]
extras = linkify,plugins,rtd
whitelist_externals =
allowlist_externals =
echo
rm
setenv =
Expand Down

0 comments on commit 876c366

Please sign in to comment.