Skip to content

Commit

Permalink
Start new version; get pyright passing (#96)
Browse files Browse the repository at this point in the history
* Start new version

* Ignore for now

* Take meta attrs from dictionary result
  • Loading branch information
cpsievert authored Sep 18, 2024
1 parent 1211512 commit 3005d6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to htmltools for Python will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [UNRELEASED]



## [0.5.3] 2024-07-18

* HTML tags in docstrings are now escaped. (#90)
Expand Down
2 changes: 1 addition & 1 deletion htmltools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.5.3"
__version__ = "0.5.3.9000"

from . import svg, tags
from ._core import TagAttrArg # pyright: ignore[reportUnusedImport] # noqa: F401
Expand Down
4 changes: 2 additions & 2 deletions htmltools/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def _normalize_attr_value(x: TagAttrValue) -> Optional[str]:
return ""
if isinstance(x, (int, float)):
return str(x)
if isinstance(x, (HTML, str)):
if isinstance(x, (HTML, str)): # type: ignore[reportUnnecessaryIsInstance]
return x
raise TypeError(
f"Invalid type for attribute: {type(x)}."
Expand Down Expand Up @@ -1512,7 +1512,7 @@ def as_html_tags(
Render the dependency as a ``TagList()``.
"""
d = self.as_dict(lib_prefix=lib_prefix, include_version=include_version)
metas = [Tag("meta", **m) for m in self.meta]
metas = [Tag("meta", **m) for m in d["meta"]]
links = [Tag("link", **s) for s in d["stylesheet"]]
scripts = [Tag("script", **s) for s in d["script"]]
return TagList(*metas, *links, *scripts, self.head)
Expand Down

0 comments on commit 3005d6a

Please sign in to comment.