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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make typing-extensions and unconditional dependency #4697

Merged
merged 1 commit into from May 6, 2022

Conversation

harahu
Copy link
Contributor

@harahu harahu commented May 6, 2022

馃摎 Context

Currently, typing-extensions in only installed as a dependency for python versions <= 3.7.

This implies type annotations are pinned to the 3.8 standard, meaning we are blocked from using modern concepts, such as TypeAlias, ParamSpec and the like.

It also means that one has to use somewhat verbose branching imports, like:

if sys.version_info >= (3, 8):
    from typing import Final
else:
    from typing_extensions import Final
  • What kind of change does this PR introduce?
    • Refactoring
    • Other, please describe: Dependency addition

馃 Description of Changes

  • Add typing-extensions as an unconditional dependency.

馃寪 References

Does this depend on other work, documents, or tickets?


Contribution License Agreement

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

@harahu harahu mentioned this pull request May 6, 2022
1 task
Copy link
Contributor

@tconkling tconkling left a comment

Choose a reason for hiding this comment

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

Hooray! @vdonato, any concerns before we merge this in?

@vdonato
Copy link
Collaborator

vdonato commented May 6, 2022

No concerns from me! I'll go ahead and click merge 馃帀

@vdonato vdonato merged commit 0c1fde0 into streamlit:develop May 6, 2022
@harahu harahu deleted the harahu/types/typing-extensions branch May 6, 2022 18:20
tconkling added a commit that referenced this pull request May 10, 2022
* develop: (21 commits)
  Remove branching imports and always import from typing_extensions (#4699)
  Add type annotations for media (#4706)
  Components adjustments (#4694)
  Type annotations for type_util (#4704)
  Add type annotations for utils (#4703)
  Argument types for iframe (#4707)
  Add type annotations for write (#4686)
  Add type annotations for doc_string (#4690)
  Add type annotations for progress (#4688)
  Add type annotations for exception (#4681)
  Add type annotations for plotly_chart (#4684)
  Wrap Markdown text when there's no word break (#4696)
  Add type annotations for __init__.py (#4687)
  Make typing-extensions and unconditional dependency (#4697)
  Add type annotations for balloons (#4679)
  Add type annotations for empty (#4680)
  Add type annotations for json (#4682)
  Add type annotations for layouts (#4683)
  Add type annotations for snow (#4685)
  Import Final from typing or typing_extensions depending on the Python version (#4692)
  ...
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.

None yet

3 participants