Skip to content

Commit 344c474

Browse files
committed
Fix compatibility with mdformat 1.0.0
Closes #18
1 parent b476b07 commit 344c474

File tree

6 files changed

+27
-33
lines changed

6 files changed

+27
-33
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v5
1717
- name: Set up Python
18-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v6
1919
with:
20-
python-version: 3.13
20+
python-version: "3.14"
2121
- name: Installation (deps and package)
2222
run: pip install .
23-
- uses: pre-commit/action@v2.0.0
23+
- uses: pre-commit/action@v3.0.1
2424

2525
tests:
2626
runs-on: ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
python-version: [3.9, '3.10', 3.11, 3.12, 3.13]
29+
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14]
3030
os: [ubuntu-latest, windows-latest]
3131

3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v5
3434

3535
- name: Set up Python ${{ matrix.python-version }}
36-
uses: actions/setup-python@v4
36+
uses: actions/setup-python@v6
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939

@@ -49,7 +49,7 @@ jobs:
4949
pytest --cov=mdformat_pyproject --cov-report=xml --cov-report=term-missing
5050
5151
- name: Store PR number and commit SHA
52-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
52+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.14
5353
run: |
5454
echo "Storing PR number ${{ github.event.number }}"
5555
echo "${{ github.event.number }}" > pr_number.txt
@@ -63,14 +63,14 @@ jobs:
6363
# Triggered sub-workflow is not able to detect the original commit/PR which is available
6464
# in this workflow.
6565
- name: Store PR number
66-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
66+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.14
6767
uses: actions/upload-artifact@v4
6868
with:
6969
name: pr_number
7070
path: pr_number.txt
7171

7272
- name: Store commit SHA
73-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
73+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.14
7474
uses: actions/upload-artifact@v4
7575
with:
7676
name: commit_sha
@@ -80,7 +80,7 @@ jobs:
8080
# is executed by a different workflow `coverage-report.yml`. The reason for this
8181
# split is because `on.pull_request` workflows don't have access to secrets.
8282
- name: Store coverage report in artifacts
83-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
83+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.14
8484
uses: actions/upload-artifact@v4
8585
with:
8686
name: codecov_report
@@ -89,17 +89,17 @@ jobs:
8989
- run: |
9090
echo "The coverage report was stored in Github artifacts."
9191
echo "It will be uploaded to Codecov using [codecov.yml] workflow shortly."
92-
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.13
92+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.14
9393
9494
pre-commit-hook:
9595
runs-on: ubuntu-latest
9696

9797
steps:
98-
- uses: actions/checkout@v3
98+
- uses: actions/checkout@v5
9999
- name: Set up Python
100-
uses: actions/setup-python@v4
100+
uses: actions/setup-python@v6
101101
with:
102-
python-version: 3.13
102+
python-version: 3.14
103103

104104
- name: Installation (deps and package)
105105
run: |
@@ -117,11 +117,11 @@ jobs:
117117
runs-on: ubuntu-latest
118118
steps:
119119
- name: Checkout source
120-
uses: actions/checkout@v3
121-
- name: Set up Python 3.13
122-
uses: actions/setup-python@v4
120+
uses: actions/checkout@v5
121+
- name: Set up Python 3.14
122+
uses: actions/setup-python@v6
123123
with:
124-
python-version: 3.13
124+
python-version: 3.14
125125
- name: install flit
126126
run: |
127127
pip install flit~=3.0

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
- flake8-builtins
3030
- flake8-comprehensions
3131
- repo: https://github.com/hukkin/mdformat
32-
rev: 0.7.21
32+
rev: 1.0.0
3333
hooks:
3434
- id: mdformat
3535
additional_dependencies:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Add the following to your `.pre-commit-config.yaml`:
3636

3737
```yaml
3838
- repo: https://github.com/executablebooks/mdformat
39-
rev: 0.7.13 # Use the ref you want to point at
39+
rev: 1.0.0 # Use the ref you want to point at
4040
hooks:
4141
- id: mdformat
4242
additional_dependencies:

mdformat_pyproject/plugin.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pathlib
44
import sys
5+
from functools import cache
56
from typing import TYPE_CHECKING, MutableMapping, Optional, Sequence, Tuple, Union
67

78
import markdown_it
@@ -15,13 +16,6 @@
1516
else:
1617
import tomli as tomllib
1718

18-
if sys.version_info >= (3, 9):
19-
from functools import cache
20-
else:
21-
from functools import lru_cache
22-
23-
cache = lru_cache()
24-
2519

2620
_ConfigOptions = MutableMapping[str, Union[int, str, Sequence[str]]]
2721

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ classifiers = [
1515
"Topic :: Software Development :: Libraries :: Python Modules",
1616
]
1717
keywords = ["mdformat", "markdown", "markdown-it"]
18-
requires-python = ">=3.9"
18+
requires-python = ">= 3.10"
1919
dependencies = [
20-
"mdformat ~=0.7",
21-
"tomli ~=2.0; python_version < '3.11'"
20+
"mdformat >= 1.0.0",
21+
"tomli >= 2.0; python_version < '3.11'"
2222
]
2323
dynamic = ["version", "description"]
2424

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[tox]
2-
envlist = py3{9,10,11,12,13}, coverage, pre-commit, hook
2+
envlist = py3{10,11,12,13,14}, coverage, pre-commit, hook
33
isolated_build = True
44

5-
[testenv:py3{9,10,11,12,13}]
5+
[testenv:py3{10,11,12,13,14}]
66
extras = test
77
commands = pytest {posargs}
88

0 commit comments

Comments
 (0)