micropython / micropython-lib

Core Python libraries ported to MicroPython
Other
2.3k stars 981 forks source link

Add upip.py and pip.py dummy modules for reverse "compatibility" #820

Open adammakesthingsdev opened 4 months ago

adammakesthingsdev commented 4 months ago

Hi all, first PR here. Let me know if I did something wrong. I noticed many packages in various places (github, Python package index, blogs/guide websites, etc) still guide users to install either from a custom index like PyPi or micropython-lib using upip. As of v1.20.0 these are both deprecated by mip and removed, leaving users confused with a module not found error. My simple fix is 2 dummy packages bundled with mip that when imported throw an ImportError with an explanation and link to the Micropython page on package management with mip, which for me was surprisingly difficult to find without knowing the new name "mip" (which doesn't follow the old pattern of "u"+package name many are familiar with.) It certainly would have saved me a bit of time. Assuming my fork has no formatting issues (functionality is fine, tested on ESP32 w/ mip) I can't see why it would be a problem - it's a lightweight fix and other deprecated/renamed modules have done this or similar so there's precedent. Thanks for reviewing!