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

resolve errors flagged by MyPy #341

Open
Josverl opened this issue Mar 4, 2023 · 0 comments
Open

resolve errors flagged by MyPy #341

Josverl opened this issue Mar 4, 2023 · 0 comments
Labels

Comments

@Josverl
Copy link
Owner

Josverl commented Mar 4, 2023

when running MyPy on the snippets there are a number of additional errors flagged
Need to determine if these are false positives or that they need to be fixed

repro:

install micropython-esp32-stubs in typings folder
set MYPYPATH to 'typings'

$env:MYPYPATH="./typings"

# avoid stdlib conflicts 
del typings/os.pyi
del typings/sys.pyi

mypy .\src
(.venv) PS C:\develop\MyPython\demo> mypy .\src --no-incremental             
typings\stdlib\os\__init__.pyi:24: error: Module "io" has no attribute "BufferedRandom"  [attr-defined]
typings\stdlib\os\__init__.pyi:24: error: Module "io" has no attribute "BufferedReader"  [attr-defined]
typings\stdlib\os\__init__.pyi:368: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:370: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:518: error: Overloaded function signatures 1 and 7 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:529: error: Overloaded function signatures 2 and 6 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:529: error: Overloaded function signatures 2 and 7 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:551: error: Overloaded function signatures 4 and 6 overlap with incompatible return types  [misc]
typings\stdlib\os\__init__.pyi:551: error: Overloaded function signatures 4 and 7 overlap with incompatible return types  [misc]
src\snippets\common\validate_sys.py:22: error: Module has no attribute "print_exception"  [attr-defined]
src\snippets\common\validate_sys.py:22: note: Error code "attr-defined" not covered by "type: ignore" comment
src\snippets\common\validate_sys.py:29: error: Module has no attribute "atexit"; maybe "exit"?  [attr-defined]
src\snippets\common\validate_sys.py:29: note: Error code "attr-defined" not covered by "type: ignore" comment
src\snippets\stm32\validate_pyb.py:4: error: Cannot find implementation or library stub for module named "pyb"  [import]
src\snippets\rp2\pio_exec.py:9: error: Cannot find implementation or library stub for module named "rp2"  [import]
src\snippets\rp2\mod_rp2.py:5: error: Cannot find implementation or library stub for module named "rp2"  [import]
src\snippets\rp2\mod_rp2.py:5: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
src\snippets\rp2\mod_machine.py:80: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\rp2\mod_machine.py:81: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\esp8266\validate_machine_8266.py:19: error: Incompatible types in assignment (expression has type "DHT22", variable has type
 "DHT11")  [assignment]
src\snippets\esp8266\validate_dht_8266.py:13: error: Incompatible types in assignment (expression has type "DHT22", variable has type "DHT11")  [assignment]
src\snippets\esp32\validate_machine_2.py:120: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\esp32\validate_machine_2.py:121: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\esp32\validate_machine_2.py:124: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\esp32\validate_dht_32.py:13: error: Incompatible types in assignment (expression has type "DHT22", variable has type "DHT11")  [assignment]
src\snippets\common\validate_uio.py:8: error: Incompatible types in assignment (expression has type "BytesIO", variable has type "StringIO")  [assignment]
src\snippets\common\validate_machine_1.py:88: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
src\snippets\common\validate_machine_1.py:89: error: Incompatible types in assignment (expression has type "I2C", variable has type "SoftI2C")  [assignment]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant