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

Add PEP 561 support to Streamlit #4025

Merged

Conversation

tconkling
Copy link
Contributor

@tconkling tconkling commented Nov 8, 2021

Streamlit itself already has (some) type annotations, and we type-check the library itself.

But: apps that install Streamlit via pip can not currently typecheck that Streamlit import because Streamlit is not a "PEP 561 compatible package".

https://mypy.readthedocs.io/en/stable/installed_packages.html

(Note that this does not mean we need to type-annotate everything in Streamlit; we can continue to gradually type as we go.)

(This is a pre-req for addressing #4018)

Streamlit itself already has (some) type annotations, and we type-check the library itself.
But: apps that install Streamlit via pip can not currently typecheck that Streamlit import
because Streamlit is not a "PEP 561 compatible package".

https://mypy.readthedocs.io/en/stable/installed_packages.html

(Note that this does *not* mean we need to type-annotate everything in Streamlit; we can
continue to gradually type as we go.)

(This is a pre-req for addressing streamlit#4018)
Graphviz 0.18 changed a module name, which is causing failures
@tconkling tconkling force-pushed the tim/LibraryTypeAnnotationSupport branch from 3e9989e to e534b72 Compare November 8, 2021 22:19
@tconkling tconkling merged commit 4494de8 into streamlit:develop Nov 8, 2021
@tconkling tconkling deleted the tim/LibraryTypeAnnotationSupport branch November 8, 2021 22:27
kajarenc added a commit that referenced this pull request Nov 11, 2021
)

* * class based draft front implementation for camera_image_input

* Remove old 'Machine ID' metrics (#3999)

* Remove old 'Machine ID' metrics

* Fix tests

* pyformat

* * Rewrite CameraImageInput behaviour similar to FileUploader widget behaviour

* * Rewrite CameraImageInput behaviour similar to FileUploader widget behaviour

* * Remove commiting data to backend from CameraImageInput widget for now

* * Remove unused value from CameraImageInput widget signature

* Feature/memory metrics (#4016)

This adds a new endpoint, `/metrics`, which provides a point-in-time snapshot of the memory allocated for objects in various caches and file managers, in OpenMetrics format, both text and protobuf.

Co-authored-by: Tim Conkling <tconkling@gmail.com>

* Fix running icon to display with dark/custom themes (#3995)

* Initial draft fix

* Update to cover custom bg colors

* Reverse change in styled components

* Add testing

* Improve variable names & notes

* Revise w/ getLuminance method & add snapshot tests

* Allow resize w or w/o specified height (#3955)

* Add ability to set text placeholder for text_input (#3954)

* Draft of text_input placeholder

* Add FE text for text_input placeholder

* Update formatting

* Isolate text_input changes

* Update to keyword only

* Update parameter notes

* Fix lint error

* Update w/ e2e tests

* Modify snapshots

* Add ability to set text placeholder for text_area (#3946)

* Updates to text_area

* Add FE test

* Update to keyword arg & throw error

* Remove custom error

* Fix lint error

* Add snapshot tests for placeholder

* Update e2e tests

* Modify snapshots

* Cloud info updates in README (#4013)

* Cloud info updates in ReadMe

Updated Cloud wording, blog and sign-up links.

* Cloud updates in README

Updated wording and fixed grammatical nit

* Add `files` to CameraImageInput react state, similar to FileUploader

* Add methods from FileUploader to CameraImageInput for working with files state field

* Integrate react-webcam into CameraImageInput component, send image to backend

* Fix code font size variable (#3926)

* fix code font size variable

* change code font size variable

* Adjust body & headings line-height

* Update FE test snapshot & cypress snapshots

* Update snapshots

* Reconcile snapshot conflict

Signed-off-by: Faiazov Dmitrii <jjsolutions0110@gmail.com>
Co-authored-by: mayagbarnes <maya8617@gmail.com>
Co-authored-by: Maya Barnes <63436329+mayagbarnes@users.noreply.github.com>

* Fix Slider description text overlap with value (#3975)

* Fix Slider description text overlap with value

* Add minHeight

* Add e2e test for slider w/ long label

* Fix lint errors

* Add new cypress snapshots

Co-authored-by: mayagbarnes <maya8617@gmail.com>

* Graphviz 0.18 support (#4026)

Graphviz 0.18 changed a module name, which is causing failures

* Add PEP 561 support to Streamlit (#4025)

Streamlit itself already has (some) type annotations, and we type-check the library itself.

But: apps that install Streamlit via pip can not currently typecheck that Streamlit import because Streamlit is not a "PEP 561 compatible package".

https://mypy.readthedocs.io/en/stable/installed_packages.html

(Note that this does *not* mean we need to type-annotate everything in Streamlit; we can continue to gradually type as we go.)

(This is a pre-req for addressing #4018)

* Improve st_slider test & fix snapshot (#4029)

* * Implement "Permission" screen draft
* Implement "Take new picture" functionality

* * Remove dot from docstring

* * Remove `label` argument for camera_image_input
* Fix docstring

* * Change buttons to styled `UIButton`, set screenshot quality to maximum

* * Make form work correctly inside `clear_on_submit` form

* Add width to video constraints

* Fix typo

Co-authored-by: Thiago Teixeira <thiago@streamlit.io>
Co-authored-by: Amanda Walker <amanda@amandawalker.io>
Co-authored-by: Tim Conkling <tconkling@gmail.com>
Co-authored-by: Maya Barnes <63436329+mayagbarnes@users.noreply.github.com>
Co-authored-by: JessSm3 <93676850+JessSm3@users.noreply.github.com>
Co-authored-by: Dmitrii Faiazov <82709517+scientia-ac-labore@users.noreply.github.com>
Co-authored-by: mayagbarnes <maya8617@gmail.com>
Co-authored-by: Henry Rocha <henryrocha@protonmail.com>
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

2 participants