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

Reference/rp2 #779

Merged
merged 87 commits into from
Feb 5, 2025
Merged
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
d86ab5a
reference/rp2: Revert to exposing just the 'rp2' module and hide the …
Josverl Jan 8, 2025
89b535a
reference: Fix all errors and almost all warnings for DocStub generat…
Josverl Jan 8, 2025
777f534
reference: Update asyncio references
Josverl Jan 9, 2025
03f605a
reference: Remove `from from stdlib.xx import *` reference-stubs
Josverl Jan 14, 2025
40bfe00
reference: change_mpy_shed file caseing
Josverl Jan 14, 2025
c9ffe33
reference: Update typehints in machine and vfs modules.
Josverl Jan 15, 2025
1ef345f
reference: Refactor block device protocol imports
Josverl Jan 16, 2025
ab693d4
reference: Refactor asyncio module imports and enhance StreamReader/S…
Josverl Jan 16, 2025
a1dad4a
reference: Rename IOBase to IOBase_mp and update references across mo…
Josverl Jan 20, 2025
def9270
reference: Force AbstractBlock class def using @overloads.
Josverl Jan 20, 2025
8095d46
reference: Force `Pin.__call__` using @overloads
Josverl Jan 20, 2025
8cf80c5
Add 1.24.1 docstubs
Josverl Jan 21, 2025
507b8fe
reference: Fixes based on stub QA Testing
Josverl Jan 22, 2025
7d78d90
doc stdlib update process
Josverl Jan 24, 2025
f105364
tests: Fix QA tests for richer stubs
Josverl Jan 24, 2025
a4ca7f4
reference: Update SSL type hints
Josverl Jan 24, 2025
3360097
Merge branch 'reference/rp2' of https://github.com/josverl/micropytho…
Josverl Jan 24, 2025
9bfbd61
stdlib-stubs: Update SSL and OS type hints with overloads for better …
Josverl Jan 24, 2025
62c6820
doc stdlib update process
Josverl Jan 24, 2025
47c57cd
stdlib: Switch to uv for packaging
Josverl Jan 24, 2025
4b28e98
stdlib: automatically update _mpy_shed
Josverl Jan 24, 2025
9adc403
stdlib-stubs: Enhance SSL type hints and update wrap_socket implement…
Josverl Jan 25, 2025
80f5438
stdlib-stubs: Add handcrafted asyncio type stubs
Josverl Jan 25, 2025
d750efd
chore: Remove unused dev-dependencies section from pyproject.toml
Josverl Jan 25, 2025
eb63a12
stdlib-stubs: Remove deprecated asyncio unix_events stubs and update …
Josverl Jan 25, 2025
20bf414
tests: Update stub installation logic and remove obsolete PowerShell …
Josverl Jan 25, 2025
9a1f2ca
refactor: Update asyncio tests
Josverl Jan 25, 2025
5419629
tests: Update asyncio test files to ignore mypy linter warnings
Josverl Jan 26, 2025
445ef44
reference&stdlib: Update typing annotations and overloads in ESPNow a…
Josverl Jan 26, 2025
3d05716
tests: Clean up test files by improving code clarity
Josverl Jan 26, 2025
8cbaad2
stdlib: Improve code formatting and update build options in stdlib stubs
Josverl Jan 27, 2025
b33a1dc
chore: Cleanup manaul stubs
Josverl Jan 27, 2025
f998741
chore: cleanup preview stubs
Josverl Jan 27, 2025
7ba51ad
tests: Update stdlib tests
Josverl Jan 27, 2025
e2063ad
refactor: Update pyproject.toml structure and improve metadata organi…
Josverl Jan 28, 2025
d5ad9cd
refactor: Clean up and optimize quality test files
Josverl Jan 28, 2025
ef95d66
reference: Add OneWire driver and update module names in rp2.
Josverl Jan 28, 2025
13898b8
chore: Remove unused __mpy_types__.pyi file
Josverl Jan 28, 2025
a188c7e
chore: statistics
Josverl Jan 28, 2025
a5672bc
Tests: Update for esp_c6 and esp_s3 - add stubs-ignore comments in Q…
Josverl Jan 28, 2025
0368926
initial release of v1.24.1 typestubs using the reference-stub archit…
Josverl Jan 28, 2025
d894a49
chore: update README with installation instructions
Josverl Jan 28, 2025
af24dc9
Add preview stubs
Josverl Jan 28, 2025
e089e50
docs: Update README with installation instructions for stub packages
Josverl Jan 28, 2025
b8f8019
Merge branch 'main' into reference/rp2
Josverl Jan 28, 2025
867d708
gor: fix .gitignore, check in micropython modules
Josverl Jan 28, 2025
22c5fab
chore:
Josverl Jan 28, 2025
b8cbf6f
reference: machine.heap*, document heap management functions
Josverl Jan 29, 2025
443e4a1
stdlib: Update README with build instructions.
Josverl Jan 29, 2025
90be558
reference: move _TimeTuple for unified time representation to _mpy_shed
Josverl Jan 29, 2025
b0f7819
refactor: remove micropython.pyi frommicropython-core-stubs
Josverl Jan 29, 2025
4c0485b
Add Stubs for v1.24.1
Josverl Jan 29, 2025
9ce4d18
add v1.25..0 preview stubs
Josverl Jan 29, 2025
6322fcf
tests: fix kbd_intr call to use integer instead of string
Josverl Jan 29, 2025
b79d6d4
tests: add rp2-rpi_pico2_w
Josverl Jan 29, 2025
5a57fdf
Build and add v1.24.1 stubs
Josverl Jan 29, 2025
ce99ee6
docs: update template
Josverl Jan 29, 2025
01ed9b8
Build and add v1.25.0-preview stubs
Josverl Jan 29, 2025
b3ec7c7
chore: cleanup old preview
Josverl Jan 29, 2025
9357680
Update contributers.
Josverl Jan 29, 2025
8df201a
reference: enhance type checking for rp2.PIO
Josverl Jan 30, 2025
dea2b1d
test: suppress error in aiorepl
Josverl Jan 30, 2025
e74d96e
chore: update snippets workspace
Josverl Jan 30, 2025
9d3ae6d
chore: streamline pyproject.toml and conftest.py configurations; add …
Josverl Jan 31, 2025
ac3a4c0
reference: enhance type annotations for readblocks and writeblocks me…
Josverl Jan 31, 2025
6f738a5
reference: add overload for dupterm_notify to notify REPL of input av…
Josverl Feb 5, 2025
158a0f9
docs: Document known Limitations for v1.24.1 of micropython-stubs
Josverl Feb 5, 2025
4e92567
db: publish to testpypi
Josverl Feb 5, 2025
6504021
chore
Josverl Feb 5, 2025
95a4a96
reference: restructure ASMPIOEmit
Josverl Feb 5, 2025
c42084e
feat: add TestPyPI configuration and overload for dupterm_notify func…
Josverl Feb 5, 2025
456b9bd
test: update stubs-ignore comments for compatibility with version cha…
Josverl Feb 5, 2025
5afc882
refactor: remove obsolete quality test files for rp2 and stdlib
Josverl Feb 5, 2025
a1ed32b
chore: add Peter Hinch as a contributor for QA async examples
Josverl Feb 5, 2025
d2fee97
stdlib: build - add version option to update command and create publi…
Josverl Feb 5, 2025
12d3b87
ci: enhance get-doc-stubs workflow to enrich documentation stubs
Josverl Feb 5, 2025
ceafaa3
chore: update classifiers in stdlib pyproject.toml
Josverl Feb 5, 2025
4cf4abc
QA tests: refactor asm_pio test
Josverl Feb 5, 2025
f8e0171
v1.24.1 - Update stubs
Josverl Feb 5, 2025
ee07f2b
update reference
Josverl Feb 5, 2025
60096ab
v1.24.1- Build packages
Josverl Feb 5, 2025
06b29b9
Merge branch 'main' into reference/rp2
Josverl Feb 5, 2025
94ffe7d
Merge branch 'reference/rp2' of https://github.com/josverl/micropytho…
Josverl Feb 5, 2025
2959e98
stdlib : Publish to pypi.
Josverl Feb 5, 2025
df171ad
v1.24.1 - Publish board stubs.
Josverl Feb 5, 2025
0748187
tests: Move tests to feat_asm_pio and add to snippets workspace
Josverl Feb 5, 2025
00bd2a5
docs: Update espnow.pyi to remove redundant links and clarify asyncio…
Josverl Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
reference: machine.heap*, document heap management functions
Signed-off-by: Jos Verlinde <[email protected]>
Josverl committed Jan 29, 2025
commit b8cbf6fe6fe8570800963de57f880be9b764b8f3
96 changes: 70 additions & 26 deletions micropython-reference/micropython/__init__.pyi
Original file line number Diff line number Diff line change
@@ -579,28 +579,6 @@ def heap_unlock() -> int:
requires ``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``.
"""

def heap_locked() -> bool:
"""
Lock or unlock the heap. When locked no memory allocation can occur and a
`MemoryError` will be raised if any heap allocation is attempted.
`heap_locked()` returns a true value if the heap is currently locked.

These functions can be nested, ie `heap_lock()` can be called multiple times
in a row and the lock-depth will increase, and then `heap_unlock()` must be
called the same number of times to make the heap available again.

Both `heap_unlock()` and `heap_locked()` return the current lock depth
(after unlocking for the former) as a non-negative integer, with 0 meaning
the heap is not locked.

If the REPL becomes active with the heap locked then it will be forcefully
unlocked.

Note: `heap_locked()` is not enabled on most ports by default,
requires ``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``.
"""
...

def kbd_intr(chr: int) -> None:
"""
Set the character that will raise a `KeyboardInterrupt` exception. By
@@ -707,28 +685,94 @@ def kbd_intr(chr) -> None:
"""
...

def heap_lock() -> Incomplete: ...
def heap_unlock() -> Incomplete: ...
def heap_lock() -> int:
"""
Lock the heap. When locked no memory allocation can occur and a
`MemoryError` will be raised if any heap allocation is attempted.
`heap_locked()` returns a true value if the heap is currently locked.

These functions can be nested, ie `heap_lock()` can be called multiple times
in a row and the lock-depth will increase, and then `heap_unlock()` must be
called the same number of times to make the heap available again.

# decorators
Both `heap_unlock()` and `heap_locked()` return the current lock depth
(after unlocking for the former) as a non-negative integer, with 0 meaning
the heap is not locked.

If the REPL becomes active with the heap locked then it will be forcefully
unlocked.

Note: `heap_locked()` is not enabled on most ports by default,
requires ``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``.
"""
...

def heap_unlock() -> int:
"""
Unlock the heap. When locked no memory allocation can occur and a
`MemoryError` will be raised if any heap allocation is attempted.
`heap_locked()` returns a true value if the heap is currently locked.

These functions can be nested, ie `heap_lock()` can be called multiple times
in a row and the lock-depth will increase, and then `heap_unlock()` must be
called the same number of times to make the heap available again.

Both `heap_unlock()` and `heap_locked()` return the current lock depth
(after unlocking for the former) as a non-negative integer, with 0 meaning
the heap is not locked.

If the REPL becomes active with the heap locked then it will be forcefully
unlocked.

Note: `heap_locked()` is not enabled on most ports by default,
requires ``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``.
"""
...

def heap_locked() -> bool:
"""
Lock or unlock the heap. When locked no memory allocation can occur and a
`MemoryError` will be raised if any heap allocation is attempted.
`heap_locked()` returns a true value if the heap is currently locked.

These functions can be nested, ie `heap_lock()` can be called multiple times
in a row and the lock-depth will increase, and then `heap_unlock()` must be
called the same number of times to make the heap available again.

Both `heap_unlock()` and `heap_locked()` return the current lock depth
(after unlocking for the former) as a non-negative integer, with 0 meaning
the heap is not locked.

If the REPL becomes active with the heap locked then it will be forcefully
unlocked.

Note: `heap_locked()` is not enabled on most ports by default,
requires ``MICROPY_PY_MICROPYTHON_HEAP_LOCKED``.
"""
...

# decorators
@overload
def viper(func: Callable) -> Callable:
"""
The Viper code emitter is not fully compliant. It supports special Viper native data types in pursuit of performance.
Integer processing is non-compliant because it uses machine words: arithmetic on 32 bit hardware is performed modulo 2**32.
Like the Native emitter Viper produces machine instructions but further optimisations are performed, substantially increasing
performance especially for integer arithmetic and bit manipulations.
See: https://docs.micropython.org/en/latest/reference/speed_python.html?highlight=viper#the-native-code-emitter
"""
...

@overload
def native(func: Callable) -> Callable:
"""
This causes the MicroPython compiler to emit native CPU opcodes rather than bytecode.
It covers the bulk of the MicroPython functionality, so most functions will require no adaptation.
See: https://docs.micropython.org/en/latest/reference/speed_python.html?highlight=viper#the-native-code-emitter
See: https://docs.micropython.org/en/latest/reference/speed_python.html#the-native-code-emitter
"""
...

@overload
def asm_thumb(func: Callable) -> Callable:
"""
This decorator is used to mark a function as containing inline assembler code.
444 changes: 0 additions & 444 deletions stubs/micropython-v1_24_1-esp32-ESP32_GENERIC-merged/doc_stubs.json

This file was deleted.