Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy failure against sample code from watchdog homepage #840

Closed
laoshaw opened this issue Sep 16, 2021 · 0 comments · Fixed by #908 or #933
Closed

mypy failure against sample code from watchdog homepage #840

laoshaw opened this issue Sep 16, 2021 · 0 comments · Fixed by #908 or #933

Comments

@laoshaw
Copy link

laoshaw commented Sep 16, 2021

running mypy against the sample code at https://pypi.org/project/watchdog/ and it reports:

wdog1.py:4: error: Skipping analyzing "watchdog.observers": found module but no type hints or library stubs
wdog1.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
wdog1.py:5: error: Skipping analyzing "watchdog.events": found module but no type hints or library stubs
Found 2 errors in 1 file (checked 1 source file)
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Jul 9, 2022
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Jul 9, 2022
This resolves a complaint from mypy that is generated when checking
the script included in `README.rst`. The complaint is:

`Missing positional argument "emitter_class" in call to "BaseObserver"`

All of the subclasses of `BaseObserver` override `__init__()`
to remove the `emitter_class` argument, but mypy cannot see this
because `Observer` is marked as `Type[BaseObserver]`.

Removing the `emitter_class` parameter to the base class
resolves this problem.

Closes gorakhargosh#840
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 2, 2022
This allows mypy to perform platform-specific type-checking,
which fixes type-checking of the example code in `README.rst`.

Closes gorakhargosh#840
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 2, 2022
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 3, 2022
This allows mypy to perform platform-specific type-checking,
which fixes type-checking of the example code in `README.rst`.

Closes gorakhargosh#840
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 3, 2022
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 4, 2022
This allows mypy to perform platform-specific type-checking,
which fixes type-checking of the example code in `README.rst`.

Closes gorakhargosh#840
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Aug 4, 2022
kurtmckee added a commit to kurtmckee/pr-watchdog that referenced this issue Mar 10, 2023
This allows mypy to perform platform-specific type-checking,
which fixes type-checking of the example code in `README.rst`.

Closes gorakhargosh#840
BoboTiG pushed a commit that referenced this issue Mar 10, 2023
* Add mypy as a tox test environment

* Fix all of the issues reported by mypy

* Update platform-specific Observer imports so mypy understands them

This allows mypy to perform platform-specific type-checking,
which fixes type-checking of the example code in `README.rst`.

Closes #840

* Add a changelog entry

* Add mypy as a CI environment

* Resolve an error with mypy 1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants