Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Script CLI Entrypoint #382

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
name = "mistune"
description = "A sane and fast Markdown parser with useful plugins and renderers"
authors = [{name = "Hsiaoming Yang", email="me@lepture.com"}]
dependencies = []
dependencies = [
'typing_extensions >=4.6, <5; python_version < "3.11"'
]
license = {text = "BSD-3-Clause"}
dynamic = ["version"]
requires-python = ">=3.7"
Expand Down Expand Up @@ -31,6 +33,9 @@ Documentation = "https://mistune.lepture.com/"
Source = "https://github.com/lepture/mistune"
Donate = "https://github.com/sponsors/lepture"

[project.scripts]
mistune = "mistune.__main__:cli"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
Expand Down
5 changes: 4 additions & 1 deletion src/mistune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union

from typing_extensions import Literal
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from .block_parser import BlockParser
from .core import BaseRenderer, BlockState, InlineState
Expand Down
6 changes: 5 additions & 1 deletion src/mistune/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
Union,
cast,
)
from typing_extensions import Self
try:
from typing import Self
except ImportError:
from typing_extensions import Self


_LINE_END = re.compile(r'\n|$')

Expand Down
5 changes: 4 additions & 1 deletion src/mistune/inline_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
Union,
)

from typing_extensions import Literal
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from .core import InlineState, Parser
from .helpers import (
Expand Down
5 changes: 4 additions & 1 deletion src/mistune/list_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import re
from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Tuple, Match

from typing_extensions import Literal
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from .util import expand_leading_tab, expand_tab, strip_end

Expand Down
5 changes: 4 additions & 1 deletion src/mistune/renderers/html.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from typing import Any, ClassVar, Dict, Optional, Tuple

from typing_extensions import Literal
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal

from ..core import BaseRenderer, BlockState
from ..util import escape as escape_text
Expand Down
Loading