pfalcon / pycopy-lib

Standard library of the Pycopy project, minimalist and light-weight Python language implementation
https://github.com/pfalcon/pycopy
Other
246 stars 70 forks source link

Feature: Allow upip to install from test.pypi.org #72

Closed brainelectronics closed 1 year ago

brainelectronics commented 2 years ago

Relates a little bit to #46

For initial testing it would be good to enable a package installation from test.pypi.org to avoid unnecessary version dumps every time.

For sure you can simply use the non-micropython pip and install it to the unix port of micropython for testing purposes.

I just want go gather some ideas and opinions before creating a pull request for a feature nobody needs. Overall I'm thinking of an additional argument at the install function to allow another installation root URL. This might be also good for self hosted packages or other package hosts, gitlab, artifact repository ...

brainelectronics commented 1 year ago

Create a new global variable index_urls at https://github.com/pfalcon/pycopy-lib/blob/56ebf2110f3caa63a3785d439ce49b11e13c75c0/upip/upip.py#L24 as index_url = 'https://pypi.org/pypi' and use it in the get_pkg_metadata function like

f = url_open("%s/%s/json" % (index_url, name))

To use test.pypi.org change it as index_url = 'https://test.pypi.org/pypi' see micropython-package-template README

As upip is anyway decommissioned, see https://github.com/micropython/micropython-lib/pull/542 I'll close this ticket