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

Micropy install should install packages #107

Open
askpatrickw opened this issue May 15, 2020 · 1 comment
Open

Micropy install should install packages #107

askpatrickw opened this issue May 15, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@askpatrickw
Copy link
Contributor

I'm opening this in the hopes of a fruitful conversation... my proposal may not be the best path.

Is your feature request related to a problem? Please describe.
micropy install doesn't install packages, it installs stubs.
This is counter intuitive to how "install" is used in the Python world. Issue #106 is an example of this, my guess you've had this conversation before with others.

Describe the solution you'd like
micropy should actually do the install and should install packages into src/lib/ as the default behavior.

Describe alternatives you've considered
One option would be to rename install to micropy stub-package. but it would be the most awesome and helpful if it actually did the install.

Additional context
There are a couple of approaches to look into:

  1. Call micropython -m upip directly.
  2. Merge micropip.py into micropy-cli

I believe option 1 is less fragile long-term because of the danger-warning Peter puts in the comments of micropip.py. I submitted a PR today to MP to add Unix Port installation instructions without doing a build. You can easily install micropython on Linux and MacOS. Windows is unclear. Checks would need to be added to verify micropython is installed and micropython would then need to fail gracefully.

#2 is cleaner and has less dependencies. It should be possible to fix micropip's logic when it is merged to account for Paul's concerns (which I don't yet understand completely).

I'm curious what you think Braden..

@askpatrickw askpatrickw added the enhancement New feature or request label May 15, 2020
@askpatrickw askpatrickw changed the title Have micropy install do an install Micropy install should install packages May 15, 2020
@BradenM
Copy link
Owner

BradenM commented May 22, 2020

Sorry for the delay,

So you bring up a very valid argument which I actually found myself stuck on for a while when I had first started this project.

While I had always planned to (one day...) build a fully-fledged package management module within micropy (like poetry/pipenv/etc, but for micropython) I considered it to be outside the original scope of micropy--which was to automate the process of creating a project env w/ intellisense/autocompletion--and therefore held it at a lower priority than the rest of the features.

This was also complicated by the fact that micropython has the unique (to other python pkg managers) issue of having multiple different ways of installing packages, depending on the users requirements (see this passage in the docs).

None of this is a blocker by any means, in fact, it likely wouldn't be too difficult to provide a basic "install packages to src/lib" option or something similar (I have actually utilized upip in micropy-stubs to do something close, see here). But I'm not exactly sure how much of a demand there is for such a feature or when I may implement it.

If anyone wants to take a stab at it though, I'm open to PRs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants