Skip to content

Commit b9b4c12

Browse files
Ignore type issues for files where imports seem to be very broken
1 parent 2be0ce6 commit b9b4c12

File tree

5 files changed

+126
-4
lines changed

5 files changed

+126
-4
lines changed

meta/generate_tag_defs.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def main(output: TextIO):
8686
# Generate the tag
8787
generate_tag_class(output, tag)
8888

89+
# And now generate an __all__ to make sure they are all exported
90+
print("__all__ = [", file=output)
91+
for tag in tags:
92+
print(f" '{tag.name}',", file=output)
93+
print("]", file=output)
94+
8995
# Also print out things to copy across to various files
9096
print("# Copy this into pyhtml/__tags/__init__.py")
9197
print("__all__ = [")
@@ -95,7 +101,8 @@ def main(output: TextIO):
95101
print("]")
96102
print()
97103
print()
98-
print("from .generated import (")
104+
# Need a type ignore or mypy freaks out
105+
print("from .generated import ( # type: ignore")
99106
for tag in tags:
100107
print(f" {tag.name},")
101108
print(")")

pyhtml/__tags/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
]
127127

128128

129-
from .generated import (
129+
from .generated import ( # type: ignore
130130
html,
131131
base,
132132
head,

pyhtml/__tags/generated.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4579,3 +4579,118 @@ def __call__(
45794579
return super().__call__(*children, **properties)
45804580

45814581

4582+
__all__ = [
4583+
'html',
4584+
'base',
4585+
'head',
4586+
'link',
4587+
'meta',
4588+
'style',
4589+
'title',
4590+
'body',
4591+
'address',
4592+
'article',
4593+
'aside',
4594+
'footer',
4595+
'header',
4596+
'h1',
4597+
'h2',
4598+
'h3',
4599+
'h4',
4600+
'h5',
4601+
'h6',
4602+
'hgroup',
4603+
'main',
4604+
'nav',
4605+
'section',
4606+
'search',
4607+
'blockquote',
4608+
'dd',
4609+
'div',
4610+
'dl',
4611+
'dt',
4612+
'figcaption',
4613+
'figure',
4614+
'hr',
4615+
'li',
4616+
'menu',
4617+
'ol',
4618+
'p',
4619+
'pre',
4620+
'ul',
4621+
'a',
4622+
'abbr',
4623+
'b',
4624+
'bdi',
4625+
'bdo',
4626+
'br',
4627+
'cite',
4628+
'code',
4629+
'data',
4630+
'dfn',
4631+
'em',
4632+
'i',
4633+
'kbd',
4634+
'mark',
4635+
'q',
4636+
'rp',
4637+
'rt',
4638+
'ruby',
4639+
's',
4640+
'samp',
4641+
'small',
4642+
'span',
4643+
'strong',
4644+
'sub',
4645+
'sup',
4646+
'time',
4647+
'u',
4648+
'var',
4649+
'wbr',
4650+
'area',
4651+
'audio',
4652+
'img',
4653+
'map',
4654+
'track',
4655+
'video',
4656+
'embed',
4657+
'iframe',
4658+
'object',
4659+
'picture',
4660+
'portal',
4661+
'source',
4662+
'canvas',
4663+
'noscript',
4664+
'script',
4665+
'del_',
4666+
'ins',
4667+
'caption',
4668+
'col',
4669+
'colgroup',
4670+
'table',
4671+
'tbody',
4672+
'td',
4673+
'tfoot',
4674+
'th',
4675+
'thead',
4676+
'tr',
4677+
'button',
4678+
'datalist',
4679+
'fieldset',
4680+
'form',
4681+
'input',
4682+
'label',
4683+
'legend',
4684+
'meter',
4685+
'optgroup',
4686+
'option',
4687+
'output',
4688+
'progress',
4689+
'select',
4690+
'textarea',
4691+
'details',
4692+
'dialog',
4693+
'summary',
4694+
'slot',
4695+
'template',
4696+
]

pyhtml/__tags/renames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
but for the sake of being (somewhat) compatible with the original PyHTML,
77
we still export the originals.
88
"""
9-
from .generated import (
9+
from .generated import ( # type: ignore
1010
object as object_,
1111
input as input_,
1212
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ build-backend = "poetry.core.masonry.api"
5555

5656
[tool.mypy]
5757
exclude = [
58-
'meta/templates/*'
58+
'meta/templates/*',
5959
]
6060

6161
[tool.flake8]

0 commit comments

Comments
 (0)