Skip to content

Commit

Permalink
chore: bump dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Mar 29, 2024
1 parent 3ea2017 commit ddbc9fb
Show file tree
Hide file tree
Showing 14 changed files with 71 additions and 81 deletions.
1 change: 0 additions & 1 deletion lectern/contrib/define.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that adds a directive for rendering a fragment and storing the output."""


__all__ = [
"DefineDirective",
]
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/messaging.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin for handling markdown coming from messaging apps."""


__all__ = [
"MessagingOptions",
"messaging",
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/plugin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that adds a directive for running plugin code in a document."""


__all__ = [
"PluginDirective",
]
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/relative_location.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that handles relative resource locations."""


__all__ = [
"RelativeNamespacedResourceLoader",
]
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/require.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that adds a directive for requiring plugins dynamically."""


__all__ = [
"RequireDirective",
]
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/script.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that adds a directive for interpreting lectern text templates."""


__all__ = [
"ScriptDirective",
]
Expand Down
1 change: 0 additions & 1 deletion lectern/contrib/yaml_to_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Plugin that handles yaml fragments for json files."""


__all__ = [
"handle_yaml",
]
Expand Down
3 changes: 1 addition & 2 deletions lectern/directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
class Directive(Protocol):
"""Protocol for detecting directives."""

def __call__(self, fragment: Fragment, assets: ResourcePack, data: DataPack, /):
...
def __call__(self, fragment: Fragment, assets: ResourcePack, data: DataPack, /): ...


class DirectiveRegistry(Container[str, Directive]):
Expand Down
6 changes: 2 additions & 4 deletions lectern/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ def get_markdown(
self,
emit_external_files: Literal[True],
prefix: str = "",
) -> Tuple[str, Dict[str, File[Any, Any]]]:
...
) -> Tuple[str, Dict[str, File[Any, Any]]]: ...

@overload
def get_markdown(self, emit_external_files: Literal[False] = False) -> str:
...
def get_markdown(self, emit_external_files: Literal[False] = False) -> str: ...

def get_markdown(
self,
Expand Down
8 changes: 5 additions & 3 deletions lectern/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,11 @@ def parse_inline(
or (
(directory := RELATIVE_PATH_REGEX.match(code.content))
and (
directive := "@resource_pack"
if directory[0] == "assets"
else "@data_pack"
directive := (
"@resource_pack"
if directory[0] == "assets"
else "@data_pack"
)
)
and regex.match(f"{directive} {code.content}")
)
Expand Down
15 changes: 5 additions & 10 deletions lectern/fragment.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,13 @@ def with_link(
return replace(self, url=url, path=path)

@overload
def expect(self) -> None:
...
def expect(self) -> None: ...

@overload
def expect(self, name1: str, /) -> str:
...
def expect(self, name1: str, /) -> str: ...

@overload
def expect(self, name1: str, name2: str, /, *names: str) -> Sequence[str]:
...
def expect(self, name1: str, name2: str, /, *names: str) -> Sequence[str]: ...

def expect(self, *names: str):
"""Check directive arguments."""
Expand All @@ -94,12 +91,10 @@ def expect(self, *names: str):
return self.arguments

@overload
def as_file(self) -> BinaryFile:
...
def as_file(self) -> BinaryFile: ...

@overload
def as_file(self, file_type: Type[FileType]) -> FileType:
...
def as_file(self, file_type: Type[FileType]) -> FileType: ...

def as_file(self, file_type: Type[File[Any, Any]] = BinaryFile) -> File[Any, Any]:
"""Retrieve the content of the fragment as a file."""
Expand Down
18 changes: 10 additions & 8 deletions lectern/prefetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,17 @@ def prefetch_urls(
) -> str:
"""Replace remote urls in the input by data urls or links to local files."""
return "".join(
self.rewrite_fragment(
text,
fragment.url,
fragment,
external_files,
external_prefix,
(
self.rewrite_fragment(
text,
fragment.url,
fragment,
external_files,
external_prefix,
)
if fragment and fragment.url
else text
)
if fragment and fragment.url
else text
for text, fragment in self.extractor.split(source, directives)
)

Expand Down
87 changes: 44 additions & 43 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ markdown-it-py = "^3.0.0"
click = "^8.1.7"

[tool.poetry.group.dev.dependencies]
black = "^23.11.0"
pytest = "^7.4.3"
isort = "^5.12.0"
black = "^24.3.0"
pytest = "^8.1.1"
isort = "^5.13.2"
python-semantic-release = "^7.32.2"
pytest-insta = "^0.2.0"
pytest-insta = "^0.3.0"

[tool.poetry.scripts]
lectern = "lectern.cli:main"
Expand Down

0 comments on commit ddbc9fb

Please sign in to comment.