Skip to content

Commit

Permalink
dev: Silence new complaint from Mypy in CI
Browse files Browse the repository at this point in the history
A new version of either Mypy or Docutils resulted in this new error:

    nextstrain/cli/rst/sphinx.py:429: error: Cannot override class variable (previously declared on base class "SettingsSpec") with instance variable  [misc]

I don't quite understand why Mypy thinks "settings_defaults" here is an
instance variable since it's declared in the class body, but removing
the type declaration is enough to appease it (presumably because it's no
longer checking it).  The type declaration is unnecessary anyway in this
bit of code.

Note that we don't even check this file with Pyright.  It's mostly
third-party code extracted from Sphinx, and it was going to be too much
work to make it pass our type checking.  Mypy was left enabled for it
because it passed with only minor fixups, and that's still the case, but
it's also probably true that Mypy is not doing very much for us in this
file anyway.
  • Loading branch information
tsibley committed Oct 7, 2024
1 parent 953b4ac commit 6e6e63f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nextstrain/cli/rst/sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def my_wrap(text: str, width: int = MAXWIDTH, **kwargs: Any) -> List[str]:
class TextWriter(writers.Writer):
supported = ('text',)
settings_spec = ('No options here.', '', ())
settings_defaults: Dict = {}
settings_defaults = {}

output: str = None

Expand Down

0 comments on commit 6e6e63f

Please sign in to comment.