Skip to content

Fix mypy errors from 0.930 release#4218

Merged
kmcgrady merged 1 commit intostreamlit:developfrom
kmcgrady:fix/mypy
Dec 27, 2021
Merged

Fix mypy errors from 0.930 release#4218
kmcgrady merged 1 commit intostreamlit:developfrom
kmcgrady:fix/mypy

Conversation

@kmcgrady
Copy link
Copy Markdown
Collaborator

📚 Context

Please describe the project or issue background here
The latest mypy introduced changes that caused our type check to fail. This PR resolves these.

  • What kind of change does this PR introduce?

    • Other, please describe: Typing fix for latest mypy

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

try:
plt = sys.modules["matplotlib.pyplot"]
plt.close("all") # type: ignore[attr-defined]
plt.close("all")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Seems like mypy is able to figure out the sys modules from here, and this ignore is no longer needed.


if self._file_should_be_hashed(obj.__code__.co_filename):
code = getattr(obj, "__code__", None)
assert code is not None
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think this assert is needed, but it honestly is the truth, especially because we grab something from underneath

@kmcgrady kmcgrady merged commit 435e110 into streamlit:develop Dec 27, 2021
@kmcgrady kmcgrady deleted the fix/mypy branch December 27, 2021 19:13
kmcgrady pushed a commit that referenced this pull request Dec 28, 2021
tconkling added a commit to tconkling/streamlit that referenced this pull request Jan 3, 2022
* develop:
  Fix hello demo type annotation (streamlit#4228)
  Release 1.3.1 (streamlit#4220)
  Improve beta_ deprecation message (streamlit#4219)
  Changing Image Algorithm to Bilinear (streamlit#4159)
  Allow columns to be rendered to create spacing (streamlit#4217)
  Fix issue with hidden balloons (approach 2) (streamlit#4204)
  Fix mypy errors from 0.930 release (streamlit#4218)
  Fix/selectbox typings (streamlit#4194)
  Support running tests locally on Apple Silicon (streamlit#4185)
  Stop screencast recorder when user removes permission / stops using browser button. (streamlit#4180)
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.

2 participants