improve type annotations in 'docutils.transforms'
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:10: note: In module imported here:
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "TranslationProgressTotaliser":
+ sphinx/transforms/i18n.py:552:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "AddTranslationClasses":
+ sphinx/transforms/i18n.py:591:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "RemoveTranslatableInline":
+ sphinx/transforms/i18n.py:613:9: error: Incompatible types in assignment (expression has type "Node", variable has type "inline") [assignment]
+ sphinx/builders/latex/transforms.py: note: In member "apply" of class "FootnoteDocnameUpdater":
+ sphinx/builders/latex/transforms.py:40:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/builders/latex/transforms.py: note: At top level:
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "CitationReferenceTransform":
+ sphinx/builders/latex/transforms.py:541:9: error: Incompatible types in assignment (expression has type "Node", variable has type "pending_xref") [assignment]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "LiteralBlockTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
+ sphinx/builders/latex/transforms.py:577:9: error: Incompatible types in assignment (expression has type "Node", variable has type "container") [assignment]
+ sphinx/builders/html/transforms.py: note: In member "run" of class "KeyboardTransform":
+ sphinx/builders/html/transforms.py:50:9: error: Incompatible types in assignment (expression has type "Node", variable has type "literal") [assignment]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
cwltool (https://github.com/common-workflow-language/cwltool)
+ note: ... from here,
+ note: ... from here,
+ note: ... from here,
+ cwltool/software_requirements.py:32: note: ... from here:
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/sphinxext/bokeh_color.py:45: note: ... from here:
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "TranslationProgressTotaliser":
+ sphinx/transforms/i18n.py:552:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "AddTranslationClasses":
+ sphinx/transforms/i18n.py:591:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "RemoveTranslatableInline":
+ sphinx/transforms/i18n.py:613:9: error: Incompatible types in assignment (expression has type "Node", variable has type "inline") [assignment]
+ sphinx/builders/latex/transforms.py: note: In member "apply" of class "FootnoteDocnameUpdater":
+ sphinx/builders/latex/transforms.py:40:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/builders/latex/transforms.py: note: At top level:
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "CitationReferenceTransform":
+ sphinx/builders/latex/transforms.py:541:9: error: Incompatible types in assignment (expression has type "Node", variable has type "pending_xref") [assignment]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "LiteralBlockTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
+ sphinx/builders/latex/transforms.py:577:9: error: Incompatible types in assignment (expression has type "Node", variable has type "container") [assignment]
+ sphinx/builders/html/transforms.py: note: In member "run" of class "KeyboardTransform":
+ sphinx/builders/html/transforms.py:50:9: error: Incompatible types in assignment (expression has type "Node", variable has type "literal") [assignment]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "TranslationProgressTotaliser":
+ sphinx/transforms/i18n.py:552:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "AddTranslationClasses":
+ sphinx/transforms/i18n.py:591:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "RemoveTranslatableInline":
+ sphinx/transforms/i18n.py:613:9: error: Incompatible types in assignment (expression has type "Node", variable has type "inline") [assignment]
+ sphinx/builders/latex/transforms.py: note: In member "apply" of class "FootnoteDocnameUpdater":
+ sphinx/builders/latex/transforms.py:40:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/builders/latex/transforms.py: note: At top level:
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "CitationReferenceTransform":
+ sphinx/builders/latex/transforms.py:541:9: error: Incompatible types in assignment (expression has type "Node", variable has type "pending_xref") [assignment]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
+ sphinx/builders/latex/transforms.py: note: In member "run" of class "LiteralBlockTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
+ sphinx/builders/latex/transforms.py:577:9: error: Incompatible types in assignment (expression has type "Node", variable has type "container") [assignment]
+ sphinx/builders/html/transforms.py: note: In member "run" of class "KeyboardTransform":
+ sphinx/builders/html/transforms.py:50:9: error: Incompatible types in assignment (expression has type "Node", variable has type "literal") [assignment]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Could you comment on whether the new errors shown in mypy-primer are true positives?
Could you comment on whether the new errors shown in mypy-primer are true positives?
i'll need to revisit this after https://github.com/sphinx-doc/sphinx/pull/12034 is merged.
the NodeMatcher class used by Sphinx confounds the type checking of the Node.find_all method, which results in a lot (though not all) of the errors seen here
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
i don't really understand this one. the snippet in sphinx is
for node in self.document.findall(addnodes.translatable):
node.preserve_original_messages()
which seems ok, no? addnodes.translatable is indeed a class
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx) - sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer": + sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes": - sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
should be fixed in https://github.com/python/typeshed/pull/11471
- sphinx/transforms/init.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
this will have to be suppressed in sphinx. the implementation is not friendly to type checking
- sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
- sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
i don't understand why this is causing an error
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
should be fixed in https://github.com/python/typeshed/pull/11471
alectryon (https://github.com/cpitclaudel/alectryon)
- alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
should be fixed in https://github.com/python/typeshed/pull/11471
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx) - sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer": + sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes": - sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc] + sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment] + sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages": + sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
I don't understand this error
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
- alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
The alceytron error is probably because of the new attribute being set though I don't know why it would raise (maybe because it's untyped?).
As for the error on the Sphinx side, I don't know why it would raise an error for that transform but not for others (maybe is it because of the += that we use?)
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/transforms/__init__.py: note: In member "apply_transforms" of class "SphinxTransformer":
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
- sphinx/transforms/__init__.py:83:13: error: "apply_transforms" undefined in superclass [misc]
+ sphinx/transforms/__init__.py:273:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:102:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
- sphinx/builders/latex/transforms.py: note: In member "run" of class "BibliographyTransform":
- sphinx/builders/latex/transforms.py:525:13: error: "BibliographyTransform" has no attribute "document" [attr-defined]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:84: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:274:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:103:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:526: error: Unused "type: ignore" comment [unused-ignore]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:84: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:274:9: error: Incompatible types in assignment (expression has type "Node", variable has type "Element") [assignment]
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:103:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:144:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:526: error: Unused "type: ignore" comment [unused-ignore]
alectryon (https://github.com/cpitclaudel/alectryon)
+ alectryon/docutils.py:206: error: "Transform" has no attribute "is_post_transform" [attr-defined]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:290:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: At top level:
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:103:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:143:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:524: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:164:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:165:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:290:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: At top level:
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:103:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:143:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:524: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:164:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:165:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:290:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: At top level:
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:103:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:143:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:524: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:164:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:165:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
I got CI to pass but some of @picnixz's review has not been addressed.
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:296:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: At top level:
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:110:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:143:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:529: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:208:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:209:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
Diff from mypy_primer, showing the effect of this PR on open source code:
sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/transforms/__init__.py:94: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/transforms/__init__.py: note: In member "apply" of class "ExtraTranslatableNodes":
+ sphinx/transforms/__init__.py:296:13: error: Unsupported target for indexed assignment ("Node") [index]
+ sphinx/transforms/__init__.py: note: At top level:
+ sphinx/transforms/i18n.py: note: In member "apply" of class "PreserveTranslatableMessages":
+ sphinx/transforms/i18n.py:110:43: error: Only concrete class can be given where "type[translatable]" is expected [type-abstract]
+ sphinx/io.py: note: In member "setup" of class "SphinxI18nReader":
+ sphinx/io.py:143:40: error: Only concrete class can be given where "type[Transform]" is expected [type-abstract]
+ sphinx/builders/latex/transforms.py:529: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/builders/linkcheck.py: note: In member "run" of class "HyperlinkCollector":
+ sphinx/builders/linkcheck.py:208:37: error: Argument 1 to "find_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
+ sphinx/builders/linkcheck.py:209:36: error: Argument 2 to "_add_uri" of "HyperlinkCollector" has incompatible type "Node"; expected "Element" [arg-type]
@danieleades you moved this back to draft, anything that still needs to get done?