forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
refine stubs-building procedure #4907
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f51ca53
refine stubs-building procedure
jepler acc6bec
exclude test-stubs files from docs
jepler 95535a2
fix doc building more
jepler a8e599a
upload the 'sdist' file as an artifact / to s3, not the whole circuit…
jepler 6a48c69
tighten conditions under which pypi upload is attempted
jepler 6a42989
Actually reduce the README text for the stubs package
jepler 89f7652
objtuple: Move mp_obj_is_tuple_compatible to obj.h.
jepler 05aa8ea
mp_obj_get_array: Work with namedtuple, attrtuple.
jepler 9449a35
time: Allow constructing a struct_time from another struct_time
jepler 3191357
Merge remote-tracking branch 'origin/main' into refine-stubs
jepler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ dist/ | |
build/ | ||
bin/ | ||
circuitpython-stubs/ | ||
test-stubs/ | ||
build-*/ | ||
|
||
# Test failure outputs | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
recursive-include . *.pyi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
CircuitPython | ||
============= | ||
|
||
.. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png | ||
|
||
|Build Status| |Doc Status| |License| |Discord| |Weblate| | ||
|
||
`circuitpython.org <https://circuitpython.org>`__ \| `Get CircuitPython <#get-circuitpython>`__ \| | ||
`Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \| | ||
`Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \| | ||
`Project Structure <#project-structure>`__ | ||
|
||
**CircuitPython** is a *beginner friendly*, open source version of Python for tiny, inexpensive | ||
computers called microcontrollers. | ||
|
||
This package contains the "stubs", or type definitions for CircuitPython. With some advanced | ||
editors and other tools, this information can be identify TypeErrors, AttributeErrors, and other | ||
problems before you deploy your code to a device and can even help autocomplete your code. | ||
|
||
.. |Build Status| image:: https://github.com/adafruit/circuitpython/workflows/Build%20CI/badge.svg | ||
:target: https://github.com/adafruit/circuitpython/actions?query=branch%3Amain | ||
.. |Doc Status| image:: https://readthedocs.org/projects/circuitpython/badge/?version=latest | ||
:target: http://circuitpython.readthedocs.io/ | ||
.. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg | ||
:target: https://adafru.it/discord | ||
.. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg | ||
:target: https://choosealicense.com/licenses/mit/ | ||
.. |Weblate| image:: https://hosted.weblate.org/widgets/circuitpython/-/svg-badge.svg | ||
:target: https://hosted.weblate.org/engage/circuitpython/?utm_source=widget |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh -e | ||
rm -rf test-stubs | ||
python3 -mvenv test-stubs | ||
. test-stubs/bin/activate | ||
pip install mypy isort black wheel | ||
rm -rf circuitpython-stubs .mypy_cache | ||
make stubs | ||
pip install --force-reinstall circuitpython-stubs/dist/circuitpython-stubs-*.tar.gz | ||
mypy -c 'import busio; b: busio.I2C; b.writeto(0x30, b"")' | ||
! mypy -c 'import busio; b: busio.I2C; b.readfrom_into(0x30, b"")' | ||
! mypy -c 'import busio; b: busio.I2C; b.write(0x30, b"")' | ||
echo "(The above two tests are expected to show type errors)" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.