Skip to content

Commit

Permalink
Ignore type issues for files where imports seem to be very broken
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Sep 8, 2023
1 parent 2be0ce6 commit b9b4c12
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 4 deletions.
9 changes: 8 additions & 1 deletion meta/generate_tag_defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ def main(output: TextIO):
# Generate the tag
generate_tag_class(output, tag)

# And now generate an __all__ to make sure they are all exported
print("__all__ = [", file=output)
for tag in tags:
print(f" '{tag.name}',", file=output)
print("]", file=output)

# Also print out things to copy across to various files
print("# Copy this into pyhtml/__tags/__init__.py")
print("__all__ = [")
Expand All @@ -95,7 +101,8 @@ def main(output: TextIO):
print("]")
print()
print()
print("from .generated import (")
# Need a type ignore or mypy freaks out
print("from .generated import ( # type: ignore")
for tag in tags:
print(f" {tag.name},")
print(")")
Expand Down
2 changes: 1 addition & 1 deletion pyhtml/__tags/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
]


from .generated import (
from .generated import ( # type: ignore
html,
base,
head,
Expand Down
115 changes: 115 additions & 0 deletions pyhtml/__tags/generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -4579,3 +4579,118 @@ def __call__(
return super().__call__(*children, **properties)


__all__ = [
'html',
'base',
'head',
'link',
'meta',
'style',
'title',
'body',
'address',
'article',
'aside',
'footer',
'header',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'hgroup',
'main',
'nav',
'section',
'search',
'blockquote',
'dd',
'div',
'dl',
'dt',
'figcaption',
'figure',
'hr',
'li',
'menu',
'ol',
'p',
'pre',
'ul',
'a',
'abbr',
'b',
'bdi',
'bdo',
'br',
'cite',
'code',
'data',
'dfn',
'em',
'i',
'kbd',
'mark',
'q',
'rp',
'rt',
'ruby',
's',
'samp',
'small',
'span',
'strong',
'sub',
'sup',
'time',
'u',
'var',
'wbr',
'area',
'audio',
'img',
'map',
'track',
'video',
'embed',
'iframe',
'object',
'picture',
'portal',
'source',
'canvas',
'noscript',
'script',
'del_',
'ins',
'caption',
'col',
'colgroup',
'table',
'tbody',
'td',
'tfoot',
'th',
'thead',
'tr',
'button',
'datalist',
'fieldset',
'form',
'input',
'label',
'legend',
'meter',
'optgroup',
'option',
'output',
'progress',
'select',
'textarea',
'details',
'dialog',
'summary',
'slot',
'template',
]
2 changes: 1 addition & 1 deletion pyhtml/__tags/renames.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
but for the sake of being (somewhat) compatible with the original PyHTML,
we still export the originals.
"""
from .generated import (
from .generated import ( # type: ignore
object as object_,
input as input_,
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ build-backend = "poetry.core.masonry.api"

[tool.mypy]
exclude = [
'meta/templates/*'
'meta/templates/*',
]

[tool.flake8]
Expand Down

0 comments on commit b9b4c12

Please sign in to comment.