Skip to content

Commit ac6932f

Browse files
authored
Merge branch 'master' into master
2 parents 3add43b + 97ab29f commit ac6932f

33 files changed

+100
-171
lines changed

.github/workflows/test-formats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22-
- name: Set up Python 3.10
22+
- name: Set up Python 3.11
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.10"
25+
python-version: "3.11"
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
@@ -43,10 +43,10 @@ jobs:
4343

4444
steps:
4545
- uses: actions/checkout@v4
46-
- name: Set up Python 3.10
46+
- name: Set up Python 3.11
4747
uses: actions/setup-python@v5
4848
with:
49-
python-version: "3.10"
49+
python-version: "3.11"
5050
- name: Install dependencies
5151
run: |
5252
python -m pip install --upgrade pip

.github/workflows/tests.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.10
17+
- name: Set up Python 3.11
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.10"
20+
python-version: "3.11"
2121
- uses: pre-commit/action@v3.0.1
2222

2323
tests:
2424

2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
python-version: ["3.10", "3.11", "3.12", "3.13"]
28+
python-version: ["3.11", "3.12", "3.13"]
2929
sphinx: [">=8,<9"]
3030
os: [ubuntu-latest]
3131
include:
32-
- os: ubuntu-latest
33-
python-version: "3.10"
34-
sphinx: ">=7,<8"
32+
# - os: ubuntu-latest
33+
# python-version: "3.11"
34+
# sphinx: ">=7,<8"
3535
- os: windows-latest
36-
python-version: "3.10"
37-
sphinx: ">=7,<8"
36+
python-version: "3.11"
37+
sphinx: ">=8,<9"
3838

3939
runs-on: ${{ matrix.os }}
4040

@@ -56,7 +56,7 @@ jobs:
5656
pytest --cov=myst_parser --cov-report=xml --cov-report=term-missing
5757
coverage xml
5858
- name: Upload to Codecov
59-
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.10 && matrix.os == 'ubuntu-latest'
59+
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.11 && matrix.os == 'ubuntu-latest'
6060
uses: codecov/codecov-action@v4
6161
with:
6262
token: ${{ secrets.CODECOV_TOKEN }}
@@ -78,10 +78,10 @@ jobs:
7878
steps:
7979
- name: Checkout source
8080
uses: actions/checkout@v4
81-
- name: Set up Python 3.10
81+
- name: Set up Python 3.11
8282
uses: actions/setup-python@v5
8383
with:
84-
python-version: "3.10"
84+
python-version: "3.11"
8585
- name: Install setup
8686
run: |
8787
python -m pip install --upgrade pip
@@ -133,10 +133,10 @@ jobs:
133133
steps:
134134
- name: Checkout source
135135
uses: actions/checkout@v4
136-
- name: Set up Python 3.10
136+
- name: Set up Python 3.11
137137
uses: actions/setup-python@v5
138138
with:
139-
python-version: "3.10"
139+
python-version: "3.11"
140140
- name: install flit
141141
run: |
142142
pip install flit~=3.4
@@ -156,10 +156,10 @@ jobs:
156156
steps:
157157
- name: Checkout source
158158
uses: actions/checkout@v4
159-
- name: Set up Python 3.10
159+
- name: Set up Python 3.11
160160
uses: actions/setup-python@v5
161161
with:
162-
python-version: "3.10"
162+
python-version: "3.11"
163163
- name: install flit and tomlkit
164164
run: |
165165
pip install flit~=3.4 tomlkit

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ exclude: >
1313
repos:
1414

1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v5.0.0
16+
rev: v6.0.0
1717
hooks:
1818
- id: check-json
1919
- id: check-yaml
2020
- id: end-of-file-fixer
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/astral-sh/ruff-pre-commit
24-
rev: v0.8.4
24+
rev: v0.14.6
2525
hooks:
26-
- id: ruff
26+
- id: ruff-check
2727
args: [--fix]
2828
- id: ruff-format
2929

3030
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v1.14.0
31+
rev: v1.18.2
3232
hooks:
3333
- id: mypy
3434
args: [--config-file=pyproject.toml]
3535
additional_dependencies:
3636
- types-urllib3
37-
- sphinx~=7.4
37+
- sphinx~=8.2
3838
- markdown-it-py~=3.0
3939
- mdit-py-plugins~=0.4.0
4040
files: >

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.10"
6+
python: "3.11"
77

88
python:
99
install:

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
suppress_warnings = ["myst.strikethrough"]
5555

5656
intersphinx_mapping = {
57-
"python": ("https://docs.python.org/3.10", None),
57+
"python": ("https://docs.python.org/3.11", None),
5858
"sphinx": ("https://www.sphinx-doc.org/en/master", None),
5959
"markdown_it": ("https://markdown-it-py.readthedocs.io/en/latest", None),
6060
}
@@ -200,6 +200,8 @@
200200
"https://www.sphinx-doc.org/en/master",
201201
"https://markdown-it-py.readthedocs.io/en/latest",
202202
]
203+
# TODO failing
204+
tippy_enable_wikitips = False
203205

204206
# -- LaTeX output -------------------------------------------------
205207

myst_parser/_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def run(self):
211211
:Name: `{name}`
212212
:Description: {content}
213213
:Arguments: {klass.required_arguments} required, {klass.optional_arguments} optional
214-
:Content: {'yes' if klass.has_content else 'no'}
214+
:Content: {"yes" if klass.has_content else "no"}
215215
:Options:
216216
"""
217217
if klass.option_spec:

myst_parser/config/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def check_url_schemes(inst: "MdParserConfig", field: dc.Field, value: Any) -> No
6464
if isinstance(value, list | tuple):
6565
if not all(isinstance(v, str) for v in value):
6666
raise TypeError(f"'{field.name}' is not a list of strings: {value!r}")
67-
value = {v: None for v in value}
67+
value = dict.fromkeys(value)
6868

6969
if not isinstance(value, dict):
7070
raise TypeError(f"'{field.name}' is not a dictionary: {value!r}")
@@ -522,8 +522,7 @@ def merge_file_level(
522522
if "html_meta" in topmatter:
523523
warning(
524524
MystWarnings.MD_TOPMATTER,
525-
"top-level 'html_meta' key is deprecated, "
526-
"place under 'myst' key instead",
525+
"top-level 'html_meta' key is deprecated, place under 'myst' key instead",
527526
)
528527
updates["html_meta"] = topmatter["html_meta"]
529528
if "substitutions" in topmatter:

myst_parser/inventory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def to_sphinx(inv: InventoryType) -> SphinxInventoryType:
8080
for domain_name, obj_types in inv["objects"].items():
8181
for obj_type, refs in obj_types.items():
8282
for refname, refdata in refs.items():
83-
objs.setdefault(f"{domain_name}:{obj_type}", {})[refname] = (
83+
objs.setdefault(f"{domain_name}:{obj_type}", {})[refname] = ( # type: ignore[assignment]
8484
inv["name"],
8585
inv["version"],
8686
refdata["loc"],

myst_parser/mdit_to_docutils/base.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,7 @@ def render_link_path(self, token: SyntaxTreeNode) -> None:
976976
def render_link_project(self, token: SyntaxTreeNode) -> None:
977977
"""Render a link token like `<project:...>`."""
978978
destination = cast(str, token.attrGet("href") or "")
979-
if destination.startswith("project:"):
980-
destination = destination[8:]
979+
destination = destination.removeprefix("project:")
981980
if destination.startswith("#"):
982981
return self.render_link_anchor(token, destination)
983982
self.create_warning(
@@ -1796,13 +1795,13 @@ def run_directive(
17961795
)
17971796
return [error_msg]
17981797

1799-
assert isinstance(
1800-
result, list
1801-
), f'Directive "{name}" must return a list of nodes.'
1798+
assert isinstance(result, list), (
1799+
f'Directive "{name}" must return a list of nodes.'
1800+
)
18021801
for i in range(len(result)):
1803-
assert isinstance(
1804-
result[i], nodes.Node
1805-
), f'Directive "{name}" returned non-Node object (index {i}): {result[i]}'
1802+
assert isinstance(result[i], nodes.Node), (
1803+
f'Directive "{name}" returned non-Node object (index {i}): {result[i]}'
1804+
)
18061805
return result
18071806

18081807
def render_substitution_inline(self, token: SyntaxTreeNode) -> None:

myst_parser/mdit_to_docutils/sphinx_.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def _handle_relative_docs(self, destination: str) -> str:
7272

7373
def render_link_project(self, token: SyntaxTreeNode) -> None:
7474
destination = cast(str, token.attrGet("href") or "")
75-
if destination.startswith("project:"):
76-
destination = destination[8:]
75+
destination = destination.removeprefix("project:")
7776
if destination.startswith("#"):
7877
return self.render_link_anchor(token, destination)
7978

@@ -108,8 +107,7 @@ def render_link_project(self, token: SyntaxTreeNode) -> None:
108107

109108
def render_link_path(self, token: SyntaxTreeNode) -> None:
110109
destination = self.md.normalizeLinkText(cast(str, token.attrGet("href") or ""))
111-
if destination.startswith("path:"):
112-
destination = destination[5:]
110+
destination = destination.removeprefix("path:")
113111
destination = self._handle_relative_docs(destination)
114112
explicit = (token.info != "auto") and (len(token.children or []) > 0)
115113
wrap_node = addnodes.download_reference(

0 commit comments

Comments
 (0)