Skip to content

Commit

Permalink
Merge branch 'EOY_stubber' into EOY_24
Browse files Browse the repository at this point in the history
  • Loading branch information
Josverl committed Jan 1, 2025
2 parents 9364da8 + 995c05b commit b9ead19
Show file tree
Hide file tree
Showing 111 changed files with 12,079 additions and 585 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ scripts/bulk_stubber.json
dist/

# code modding output saved for tests / comparison
tests/codemods/codemod_test_cases/**/output.py
tests/codemods/codemod_test_cases/**/output.*

# ignore the typings folders used in testing.
snippets/*/typings
Expand All @@ -70,3 +70,6 @@ codecov.exe

src/mpflash/coverag*
Bugs to fix-MPFlash.md

# no hypothesis patches
**/.hypothesis
35 changes: 19 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"cwd": "${workspaceFolder}",
"args": [
"-VV",
"list",
// "--board",
// "SEEED_WIO_TERMINAL",
// "PICO",
Expand Down Expand Up @@ -41,20 +40,31 @@
"cwd": "${workspaceFolder}",
"args": [
"-VV",
"get-mcu-stubs",
"--serial",
"/dev/ttyUSB0",
"build",
"--port",
"rp2",
"--board",
"RPI_PICO",
//
// "enrich",
// "--stubs",
// "repos\\micropython-stubs\\stubs\\micropython-v1_23_0-docstubs\\network",
// "--docstubs",
// "repos\\intellij-micropython\\typehints\\micropython",
//
// "get-docstubs",
// "--version",
// "preview",
// "--no-clean-rst",
// "get-mcu-stubs",
// "--serial",
// "/dev/ttyUSB0",
// "get-frozen",
// "--version",
// "preview",
// "switch",
// "v1.20.0",
// "build",
// "--port",
// "esp32",
// "--board",
// "generic",
// "build",
// "publish",
// "--test-pypi",
// "--version",
Expand Down Expand Up @@ -177,13 +187,6 @@
// but may cause issue with pytest-cov coverage reporting
"subProcess": false,
},
{
"name": "PowerShell Launch Current File",
"type": "PowerShell",
"request": "launch",
"script": "${file}",
"cwd": "${file}"
},
],
"inputs": [
{
Expand Down
135 changes: 133 additions & 2 deletions .vscode/micropython-dict.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,145 @@
adcs
adcx
adcy
aioble
AIOESP
aiter
aivar
annamaa
asend
atten
Autoflake
basicgit
baudrate
behaviour
boardname
boardstubs
braden
bssid
btree
bufs
bufx
bufy
bursty
capsys
chdir
codemod
configtuple
cpython
createstubs
cryptolib
currentmodule
dastultz
deadtime
Decomp
deepsleep
Deinitialises
dequeu
descr
docpages
docstr
docstream
docstrings
docstub
docstubs
ECONNRESET
EEXIST
EHOSTUNREACH
EISDIR
ENOENT
espnow
extframe
firstbit
fname
framebuf
framebuffer
fsobj
fwid
gattc
GATTS
gmtime
GPIO
gzdict
hclk
hexlify
imphook
initialises
IPPROTO
isconnected
josverl
jsondb
keepends
libcst
linecounter
loboris
loguru
markdownlint
MCLK
microcontroller
microcontrollers
micropython
milli
mitm
mklink
modulelist
MOSI
mpflash
mpls
mpremote
mystubs
neopixel
noindex
NONCONN
NRPA
oneliner
onewire
openamp
optimisation
osdebug
pathnames
pclk
pfalcon
prescaler
pybd
pyboard
pybricks
pycom
pycopy
pylintrc
pymak
pyright
pytest
pytestmark
pytests
readbit
readblock
readblocks
readbyte
recvinto
reqs
ringbuffer
rssi
serialport
setfiler
setfilter
sourcecode
sourcery
stopwords
strerror
Stubber
stubfiles
stubfolder
stubgen
stuborder
sysclk
sysname
testrepo
textblock
thonny
tinypico
toctree
typeshed
UART
uasync
uasyncio
ubinascii
Expand All @@ -32,15 +152,26 @@ uhashlib
ujson
ulab
umqtt
unstubbables
updent
upip
uplatform
upysh
urequests
urequests
uselect
usocket
ussl
ustruct
usys
utarfile
uzlib
webrepl
WLAN
wipy
WIZNET
WLAN
worklist
writebit
writeblocks
writebyte
writeln
xfer
49 changes: 13 additions & 36 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,19 @@
"peacock.color": "#9b5f28",
"peacock.remoteColor": "#e2b991",
"cSpell.words": [
"aivar",
"annamaa",
"braden",
"chdir",
"cpython",
"createstubs",
"dastultz",
"fname",
"fwid",
"josverl",
"loboris",
"markdownlint",
"mklink",
"mpls",
"mystubs",
"pfalcon",
"pybd",
"pyboard",
"pybricks",
"pylintrc",
"pyright",
"pytest",
"pytests",
"Stubber",
"stubfiles",
"stubgen",
"stuborder",
"sysname",
"testrepo",
"thonny",
"tinypico",
"typeshed",
"ulab",
"unstubbables",
"upysh",
"webrepl"
"asname",
"classdef",
"functiondef",
"intellij",
"noblack",
"outputjson",
"pyrightconfig",
"pytestconfig",
"rootpath",
"stubfile",
"typehints",
"ufoo",
"upackage"
],
"terminal.integrated.persistentSessionReviveProcess": "never",
"workbench.colorCustomizations": {
Expand Down
89 changes: 89 additions & 0 deletions WIP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@


- [ ] class NeoPixel: - indexing
https://github.com/Josverl/micropython-stubs/issues/764

ERROR root:typecheck.py:171 "tests/quality_tests/check_rp2/check_neopixel.py"(10,0): "__setitem__" method not defined on type "NeoPixel"
ERROR root:typecheck.py:171 "tests/quality_tests/check_rp2/check_neopixel.py"(12,10): "__getitem__" method not defined on type "NeoPixel"

- [ ] mod:socket - missing module constants
ERROR root:typecheck.py:171 "tests/quality_tests/feat_micropython/check_functions.py"(5,7): "AF_INET" is not defined
ERROR root:typecheck.py:171 "tests/quality_tests/feat_micropython/check_functions.py"(5,16): "SOCK_STREAM" is not defined
ERROR root:typecheck.py:171 "tests/quality_tests/feat_micropython/check_functions.py"(7,7): "AF_INET" is not defined
ERROR root:typecheck.py:171 "tests/quality_tests/feat_micropython/check_functions.py"(7,16): "SOCK_DGRAM" is not defined

- [ ] uasyncio.Task
subclass :
class Task(futures._PyFuture):
methods :
- cancel
- __await__
- s.read() / __call__ ?>?


INFO root:typecheck.py:175 "tests/quality_tests/feat_uasyncio/check_demo/aiorepl.py"(67,26): Cannot access attribute "cancel" for class "Task"
Attribute "cancel" is unknown
INFO root:typecheck.py:175 "tests/quality_tests/feat_uasyncio/check_demo/aiorepl.py"(69,26): "Task" is not awaitable
"Task" is incompatible with protocol "Awaitable[_T_co@Awaitable]"
"__await__" is not present

- [ ] # TODO: fix type stubs asyncio.StreamReader
```python

awritestr: Generator ## = <generator>
wait_closed: Generator ## = <generator>
drain: Generator ## = <generator>
readexactly: Generator ## = <generator>
readinto: Generator ## = <generator>
awrite: Generator ## = <generator>
readline: Generator ## = <generator>
aclose: Generator ## = <generator>

# read: Generator ## = <generator>
async def read(self, n=-1):
"""Read up to `n` bytes from the stream.
If `n` is not provided or set to -1,
read until EOF, then return all read bytes.
If EOF was received and the internal buffer is empty,
return an empty bytes object.

If `n` is 0, return an empty bytes object immediately.

If `n` is positive, return at most `n` available bytes
as soon as at least 1 byte is available in the internal buffer.
If EOF is received before any byte is read, return an empty
bytes object.

Returned value is not limited with limit, configured at stream
creation.

If stream was paused, this function will automatically resume it if
needed.
"""

```

- [ ] stdib - io
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_io.py"(11,9): "BufferedWriter" is not a known attribute of module "io"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_json/check_json.py"(38,26): No parameter named "separators"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_files.py"(40,29): Type "str | list[dict[Unknown, Unknown]]" is not assignable to declared type "List[str]"
Type "str | list[dict[Unknown, Unknown]]" is not assignable to type "List[str]"
"str" is not assignable to "List[str]"
INFO root:typecheck.py:175 "tests/quality_tests/feat_stdlib/check_os/check_files.py"(56,24): Type of "subdir" is "List[str]"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_files.py"(57,17): Type "list[str | dict[Unknown, Unknown]]" is not assignable to declared type "List[dict[Unknown, Unknown]]"
"list[str | dict[Unknown, Unknown]]" is not assignable to "List[dict[Unknown, Unknown]]"
Type parameter "_T@list" is invariant, but "str | dict[Unknown, Unknown]" is not the same as "dict[Unknown, Unknown]"
Consider switching from "list" to "Sequence" which is covariant
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_uname.py"(19,12): "assert_type" mismatch: expected "str" but received "str | Unknown"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_uname.py"(20,12): "assert_type" mismatch: expected "str" but received "str | Unknown"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_uname.py"(21,12): "assert_type" mismatch: expected "str" but received "str | Unknown"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_uname.py"(22,12): "assert_type" mismatch: expected "str" but received "str | Unknown"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_os/check_uname.py"(23,12): "assert_type" mismatch: expected "str" but received "str | Unknown"
ERROR root:typecheck.py:171 "tests/quality_tests/feat_stdlib/check_sys/check_sys.py"(24,20): Argument of type "exc" cannot be assigned to parameter "exc" of type "BaseException" in function "print_exception"



- [ ] Disable ruff warnings
- UP015, UP031, UP032

Loading

0 comments on commit b9ead19

Please sign in to comment.