Skip to content

Commit 1fda06d

Browse files
authored
Merge branch 'master' into dependabot/pip/sphinxext-opengraph-approx-eq-0.8.2
2 parents 726b172 + 3fb7d9e commit 1fda06d

File tree

27 files changed

+224
-84
lines changed

27 files changed

+224
-84
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Bug Report
2+
description: Create a bug report 🐛
3+
labels: ['bug']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.
8+
- type: input
9+
attributes:
10+
label: What version of `myst-parser` are you using?
11+
description: 'For example: 1.0.0'
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: What version dependencies are you using?
17+
description: 'e.g. for docutils and sphinx'
18+
validations:
19+
required: true
20+
- type: dropdown
21+
id: os
22+
attributes:
23+
label: What operating system are you using?
24+
options:
25+
- Mac
26+
- Windows
27+
- Linux
28+
- Other
29+
validations:
30+
required: true
31+
- type: textarea
32+
attributes:
33+
label: Describe the Bug
34+
description: A clear and concise description of the bug.
35+
validations:
36+
required: true
37+
- type: textarea
38+
attributes:
39+
label: Expected Behavior
40+
description: A clear and concise description of what you expected to happen.
41+
validations:
42+
required: false
43+
- type: textarea
44+
attributes:
45+
label: To Reproduce
46+
description: Steps to reproduce the behavior, please provide clear and concise steps.
47+
validations:
48+
required: false
49+
- type: markdown
50+
attributes:
51+
value: Please ensure the steps you've provided reproduce the issue to the best of your ability.
52+
- type: markdown
53+
attributes:
54+
value: Ideally, maintainers should be able to follow the steps provided in order to reproduce the bug.
55+
- type: markdown
56+
attributes:
57+
value: Thank you for helping out the MyST team, these issues are what makes MyST better!!
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Feature Request
2+
description: Request a new feature ✨
3+
labels: ['enhancement']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thank you for taking the time to submit a feature request! Please fill out this form as completely as possible.
8+
- type: textarea
9+
attributes:
10+
label: Describe the feature you'd like to request
11+
description: A clear and concise description of what you want and what your use case is.
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Describe the solution you'd like
17+
description: A clear and concise description of what you want to happen.
18+
- type: textarea
19+
attributes:
20+
label: Describe alternatives you've considered
21+
description: A clear and concise description of any alternative solutions or features you've considered.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Documentation improvement
2+
description: Suggest improvements to the documentation 📖
3+
labels: ['documentation']
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: Thank you for taking the time to submit a suggestion! Please fill out this form as completely as possible.
8+
- type: textarea
9+
attributes:
10+
label: Describe the gap in the current documentation
11+
description: A clear and concise description of what area is currently missing or unclear.
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Describe the solution you'd like
17+
description: A clear and concise description of what you would like to see in the documentation.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Ask a question 💬
3+
url: https://github.com/executablebooks/MyST-Parser/discussions
4+
about: Ask questions and discuss ideas with other community members

.github/workflows/tests.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
python-version: ["3.8", "3.9", "3.10", "3.11"]
29-
sphinx: [">=6,<7"]
29+
sphinx: [">=7,<8"]
3030
os: [ubuntu-latest]
3131
include:
3232
- os: ubuntu-latest
3333
python-version: "3.8"
34-
sphinx: ">=5,<6"
34+
sphinx: ">=6,<7"
3535
- os: windows-latest
3636
python-version: "3.8"
37-
sphinx: ">=5,<6"
37+
sphinx: ">=6,<7"
3838

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

@@ -69,7 +69,7 @@ jobs:
6969
strategy:
7070
fail-fast: false
7171
matrix:
72-
docutils-version: ["0.17", "0.18", "0.19"]
72+
docutils-version: ["0.17", "0.18", "0.19", "0.20"]
7373

7474
steps:
7575
- name: Checkout source
@@ -101,10 +101,29 @@ jobs:
101101
- name: Run docutils CLI
102102
run: echo "test" | myst-docutils-html
103103

104+
# https://github.com/marketplace/actions/alls-green#why
105+
check: # This job does nothing and is only used for the branch protection
106+
107+
if: always()
108+
109+
needs:
110+
- pre-commit
111+
- tests
112+
- check-myst-docutils
113+
114+
runs-on: ubuntu-latest
115+
116+
steps:
117+
- name: Decide whether the needed jobs succeeded or failed
118+
uses: re-actors/alls-green@release/v1
119+
with:
120+
jobs: ${{ toJSON(needs) }}
121+
104122
publish:
105123

106124
name: Publish myst-parser to PyPi
107-
needs: [pre-commit, tests, check-myst-docutils]
125+
needs:
126+
- check
108127
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
109128
runs-on: ubuntu-latest
110129
steps:

.pre-commit-config.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,36 @@ repos:
2020
- id: trailing-whitespace
2121

2222
- repo: https://github.com/asottile/pyupgrade
23-
rev: v3.3.1
23+
rev: v3.4.0
2424
hooks:
2525
- id: pyupgrade
26-
args: [--py37-plus]
26+
args: [--py38-plus]
2727

2828
- repo: https://github.com/PyCQA/isort
2929
rev: 5.12.0
3030
hooks:
3131
- id: isort
3232

3333
- repo: https://github.com/psf/black
34-
rev: 23.1.0
34+
rev: 23.3.0
3535
hooks:
3636
- id: black
3737

3838
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.252
39+
rev: v0.0.270
4040
hooks:
4141
- id: ruff
4242

4343
- repo: https://github.com/pre-commit/mirrors-mypy
44-
rev: v1.0.1
44+
rev: v1.3.0
4545
hooks:
4646
- id: mypy
4747
args: [--config-file=pyproject.toml]
4848
additional_dependencies:
4949
- sphinx~=5.0
50-
- markdown-it-py>=1.0.0,<3.0.0
51-
- mdit-py-plugins~=0.3.4
50+
- types-urllib3
51+
- markdown-it-py~=3.0
52+
- mdit-py-plugins~=0.4.0
5253
files: >
5354
(?x)^(
5455
myst_parser/.*py|

docs/conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@
6363

6464
# -- Autodoc settings ---------------------------------------------------
6565

66-
autodoc2_packages = ["../myst_parser"]
67-
autodoc2_exclude_files = ["_docs.py"]
66+
autodoc2_packages = [
67+
{
68+
"path": "../myst_parser",
69+
"exclude_files": ["_docs.py"],
70+
}
71+
]
6872
autodoc2_hidden_objects = ["dunder", "private", "inherited"]
6973
autodoc2_replace_annotations = [
7074
("re.Pattern", "typing.Pattern"),
7175
("markdown_it.MarkdownIt", "markdown_it.main.MarkdownIt"),
7276
]
7377
autodoc2_replace_bases = [
74-
("myst_parser._compat.Protocol", "typing.Protocol"),
75-
("myst_parser._compat.TypedDict", "typing.TypedDict"),
7678
("sphinx.directives.SphinxDirective", "sphinx.util.docutils.SphinxDirective"),
7779
]
7880
autodoc2_docstring_parser_regexes = [

myst_parser/_compat.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,8 @@
11
"""Helpers for cross compatibility across dependency versions."""
2-
import sys
32
from typing import Callable, Iterable
43

54
from docutils.nodes import Element
65

7-
if sys.version_info >= (3, 8):
8-
from typing import Literal, Protocol, TypedDict, get_args, get_origin
9-
else:
10-
from typing_extensions import ( # noqa: F401
11-
Literal,
12-
Protocol,
13-
TypedDict,
14-
get_args,
15-
get_origin,
16-
)
17-
186

197
def findall(node: Element) -> Callable[..., Iterable[Element]]:
208
"""Iterate through"""

myst_parser/_docs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import annotations
33

44
import io
5-
from typing import Sequence, Union
5+
from typing import Sequence, Union, get_args, get_origin
66

77
from docutils import nodes
88
from docutils.frontend import OptionParser
@@ -13,7 +13,6 @@
1313
from sphinx.util.docutils import SphinxDirective
1414

1515
from myst_parser.parsers.docutils_ import to_html5_demo
16-
from ._compat import get_args, get_origin
1716
from .config.main import MdParserConfig
1817
from .parsers.docutils_ import Parser as DocutilsParser
1918
from .warnings_ import MystWarnings

myst_parser/config/dc_validators.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
from __future__ import annotations
33

44
import dataclasses as dc
5-
from typing import Any, Sequence
6-
7-
from myst_parser._compat import Protocol
5+
from typing import Any, Protocol, Sequence
86

97

108
def validate_field(inst: Any, field: dc.Field, value: Any) -> None:
@@ -43,6 +41,12 @@ def __call__(
4341
...
4442

4543

44+
def any_(inst, field, value, suffix=""):
45+
"""
46+
A validator that does not perform any validation.
47+
"""
48+
49+
4650
def instance_of(type_: type[Any] | tuple[type[Any], ...]) -> ValidatorType:
4751
"""
4852
A validator that raises a `TypeError` if the initializer is called

0 commit comments

Comments
 (0)