Skip to content

Don't suggest incompatible stub packages#10610

Merged
JukkaL merged 7 commits intomasterfrom
stub-py-compat
Jun 10, 2021
Merged

Don't suggest incompatible stub packages#10610
JukkaL merged 7 commits intomasterfrom
stub-py-compat

Conversation

@JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Jun 9, 2021

Keep track of supported Python versions of legacy bundled packages, and
only suggest a stub package if the major Python version is compatible.

Fixes #10602.

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2021

Diff from mypy_primer, showing the effect of this PR on open source code:

prefect (https://github.com/PrefectHQ/prefect.git)
- src/prefect/agent/agent.py:15: error: Library stubs not installed for "tornado" (or incompatible with Python 3.8)
- src/prefect/agent/agent.py:15: note: Hint: "python3 -m pip install types-tornado"
- src/prefect/agent/agent.py:16: error: Library stubs not installed for "tornado.ioloop" (or incompatible with Python 3.8)
- src/prefect/agent/agent.py:17: error: Library stubs not installed for "tornado.httpserver" (or incompatible with Python 3.8)

optuna (https://github.com/optuna/optuna.git)
- optuna/dashboard.py:29: error: Library stubs not installed for "tornado" (or incompatible with Python 3.8)
- optuna/dashboard.py:29: error: Library stubs not installed for "tornado.gen" (or incompatible with Python 3.8)
- optuna/dashboard.py:29: note: Hint: "python3 -m pip install types-tornado"

scrapy (https://github.com/scrapy/scrapy.git)
- scrapy/utils/ssl.py:1: error: Library stubs not installed for "OpenSSL" (or incompatible with Python 3.8)
- scrapy/utils/ssl.py:2: error: Library stubs not installed for "OpenSSL._util" (or incompatible with Python 3.8)
- scrapy/core/downloader/tls.py:3: error: Library stubs not installed for "OpenSSL" (or incompatible with Python 3.8)
- scrapy/core/downloader/contextfactory.py:3: error: Library stubs not installed for "OpenSSL" (or incompatible with Python 3.8)
- scrapy/core/downloader/contextfactory.py:3: note: (or run "mypy --install-types" to install all missing stub packages)
- scrapy/core/downloader/contextfactory.py:3: note: Hint: "python3 -m pip install types-openssl-python"
- scrapy/core/downloader/contextfactory.py:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
+ scrapy/utils/versions.py:4: note: (or run "mypy --install-types" to install all missing stub packages)
+ scrapy/utils/versions.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- tests/mockserver.py:12: error: Library stubs not installed for "OpenSSL" (or incompatible with Python 3.8)
- tests/test_webclient.py:11: error: Library stubs not installed for "OpenSSL" (or incompatible with Python 3.8)
- tests/test_webclient.py:11: error: Library stubs not installed for "OpenSSL.SSL" (or incompatible with Python 3.8)

paasta (https://github.com/yelp/paasta.git)
- paasta_tools/mesos/zookeeper.py:18: error: Library stubs not installed for "kazoo" (or incompatible with Python 3.7)
- paasta_tools/mesos/zookeeper.py:18: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/mesos/zookeeper.py:19: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/mesos/zookeeper.py:20: error: Library stubs not installed for "kazoo.handlers" (or incompatible with Python 3.7)
- paasta_tools/mesos/zookeeper.py:20: error: Library stubs not installed for "kazoo.handlers.threading" (or incompatible with Python 3.7)
- paasta_tools/utils.py:76: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/frameworks/task_store.py:10: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/frameworks/task_store.py:11: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/frameworks/task_store.py:14: error: Library stubs not installed for "kazoo.protocol.states" (or incompatible with Python 3.7)
- paasta_tools/autoscaling/load_boost.py:16: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/autoscaling/load_boost.py:17: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/api/views/pause_autoscaler.py:20: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/mesos/master.py:27: error: Library stubs not installed for "kazoo.handlers.threading" (or incompatible with Python 3.7)
- paasta_tools/mesos/master.py:28: error: Library stubs not installed for "kazoo.retry" (or incompatible with Python 3.7)
- paasta_tools/mesos_tools.py:41: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/marathon_tools.py:43: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/deployd/watchers.py:14: error: Library stubs not installed for "kazoo.protocol.states" (or incompatible with Python 3.7)
- paasta_tools/deployd/watchers.py:17: error: Library stubs not installed for "kazoo.recipe.watchers" (or incompatible with Python 3.7)
- paasta_tools/deployd/queue.py:14: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/deployd/queue.py:15: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/deployd/queue.py:17: error: Library stubs not installed for "kazoo.protocol.states" (or incompatible with Python 3.7)
- paasta_tools/deployd/leader.py:7: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/deployd/leader.py:9: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/deployd/leader.py:10: error: Library stubs not installed for "kazoo.recipe.election" (or incompatible with Python 3.7)
- paasta_tools/bounce_lib.py:39: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/bounce_lib.py:40: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/api/views/deploy_queue.py:18: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/api/views/deploy_queue.py:18: note: Hint: "python3 -m pip install types-kazoo"
- paasta_tools/autoscaling/autoscaling_service_lib.py:35: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)
- paasta_tools/autoscaling/autoscaling_service_lib.py:36: error: Library stubs not installed for "kazoo.exceptions" (or incompatible with Python 3.7)
- paasta_tools/deployd/master.py:13: error: Library stubs not installed for "kazoo.client" (or incompatible with Python 3.7)

bokeh (https://github.com/bokeh/bokeh.git)
+ bokeh/embed/standalone.py:36:1: note: (or run "mypy --install-types" to install all missing stub packages)
+ bokeh/embed/standalone.py:36:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
- bokeh/command/subcommands/serve.py:420:1: error: Library stubs not installed for "tornado.autoreload" (or incompatible with Python 3.7)  [import]
- bokeh/command/subcommands/serve.py:420:1: note: (or run "mypy --install-types" to install all missing stub packages)
- bokeh/command/subcommands/serve.py:420:1: note: Hint: "python3 -m pip install types-tornado"
- bokeh/command/subcommands/serve.py:420:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

tornado (https://github.com/tornadoweb/tornado.git)
+ tornado/test/__main__.py:5: error: Cannot find implementation or library stub for module named "tornado.test.runtests"
- tornado/test/__main__.py:5: error: Library stubs not installed for "tornado.test.runtests" (or incompatible with Python 3.6)
- tornado/test/__main__.py:5: note: (or run "mypy --install-types" to install all missing stub packages)
- tornado/test/__main__.py:5: note: Hint: "python3 -m pip install types-tornado"
- tornado/test/options_test.py:10: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
+ tornado/test/options_test.py:10: error: Cannot find implementation or library stub for module named "tornado.test.util"
- tornado/test/tcpserver_test.py:12: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/tcpclient_test.py:27: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/simple_httpclient_test.py:26: error: Library stubs not installed for "tornado.test.httpclient_test" (or incompatible with Python 3.6)
- tornado/test/simple_httpclient_test.py:33: error: Library stubs not installed for "tornado.test" (or incompatible with Python 3.6)
- tornado/test/simple_httpclient_test.py:41: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/process_test.py:17: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/netutil_test.py:18: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/iostream_test.py:26: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
+ tornado/test/tcpserver_test.py:12: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/tcpclient_test.py:27: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/simple_httpclient_test.py:26: error: Cannot find implementation or library stub for module named "tornado.test.httpclient_test"
+ tornado/test/simple_httpclient_test.py:33: error: Cannot find implementation or library stub for module named "tornado.test"
+ tornado/test/simple_httpclient_test.py:41: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/process_test.py:17: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/netutil_test.py:18: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/iostream_test.py:26: error: Cannot find implementation or library stub for module named "tornado.test.util"
- tornado/test/ioloop_test.py:20: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
+ tornado/test/ioloop_test.py:20: error: Cannot find implementation or library stub for module named "tornado.test.util"
- tornado/test/httpserver_test.py:31: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/httpclient_test.py:31: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
- tornado/test/gen_test.py:14: error: Library stubs not installed for "tornado.test.util" (or incompatible with Python 3.6)
+ tornado/test/httpserver_test.py:31: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/httpclient_test.py:31: error: Cannot find implementation or library stub for module named "tornado.test.util"
+ tornado/test/gen_test.py:14: error: Cannot find implementation or library stub for module named "tornado.test.util"
- tornado/test/curl_httpclient_test.py:6: error: Library stubs not installed for "tornado.test" (or incompatible with Python 3.6)
+ tornado/test/curl_httpclient_test.py:6: error: Cannot find implementation or library stub for module named "tornado.test"
+ tornado/test/curl_httpclient_test.py:11: note: (or run "mypy --install-types" to install all missing stub packages)

@JukkaL JukkaL merged commit 0095dc2 into master Jun 10, 2021
@JukkaL JukkaL deleted the stub-py-compat branch June 10, 2021 10:21
JukkaL added a commit that referenced this pull request Jun 10, 2021
Keep track of supported Python versions of legacy bundled packages, and
only suggest a stub package if the major Python version is compatible.

Fixes #10602.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--install-types suggests incompatible stub packages

3 participants