Conversation
# Conflicts: # certbot-apache/certbot_apache/_internal/configurator.py
bmw
left a comment
There was a problem hiding this comment.
Other than my inline comments, I think we should remove --no-strict-optional from tox.ini.
| def __init__(self, entry_point: pkg_resources.EntryPoint, with_prefix=False): | ||
| self.name = self.entry_point_to_plugin_name(entry_point, with_prefix) | ||
| self.plugin_cls = entry_point.load() | ||
| self.plugin_cls: Any = entry_point.load() |
There was a problem hiding this comment.
If I change this to interfaces.IPluginFactory which is what this object should be, it almost works, however, mypy complains about the number of parameters when we call self.plugin_cls(...).
Do you think it's worth either of:
- Using that interface as the type here and either fixing it or adding
type: ignorelines to makemypyhappy? - Adding a comment saying what this type can be in the future when we're off of
zope.
There was a problem hiding this comment.
Option 1. Once we have removed the interface because we moved away from zope, this code will need a fix so we cannot miss the occasion to improve the type definition here.
| self._initialized = None | ||
| self._prepared = None | ||
| self.warning_message: Optional[str] = None | ||
| self._initialized: Optional[Any] = None |
There was a problem hiding this comment.
I have a similar comment here as I do about self.plugin_cls except here the type should be interfaces.IPlugin and mypy complains about the number of parameters on the prepare call.
Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
09c79f3 to
3bd4ae0
Compare
3bd4ae0 to
773b9a1
Compare
Built on top of #8748, this PR reenables mypy strict mode and adds the appropriate corrections to pass the types checks.