pfalcon / pycopy

Pycopy - a minimalist and memory-efficient Python dialect. Good for desktop, cloud, constrained systems, microcontrollers, and just everything.
http://pycopy.readthedocs.io
MIT License
806 stars 78 forks source link

Usability: Improve "tools/mpy_cross_all" to invoke the "mpy-cross" program coming from the mpy_cross distribution #35

Closed amotl closed 5 years ago

amotl commented 5 years ago

Dear @pfalcon, @dpgeorge, @stinos, @dhylands and all maintainers of good faith in MicroPython tooling,

first things first: Thank you so much for your amazing work on MicroPython and its ecosystem - you know who you are.

Introduction

Coming from https://github.com/micropython/micropython/issues/4955 and building upon https://github.com/micropython/micropython/issues/3040 and https://github.com/micropython/micropython/issues/3057, we enabled tools/mpy_cross_all.py to invoke the mpy-cross program through the fine mpy-cross distribution package.

Setup

The operator will be able to decide to selectively install specific versions of mpy-cross like

source .venv2/bin/activate
pip install mpy-cross=1.9.4

into the Python environment running on her workstation.

Usage

Description

When running it from a Python environment where the mpy_cross modules is installed, mpy_cross_all.py will attempt to invoke mpy-cross from the mpy_cross distribution.

Otherwise, it will go down the established route of invoking mpy-cross directly, essentially expecting it to reside somewhere on $PATH.

Synopsis

source .venv2/bin/activate
time python tools/mpy_cross_all.py --out dist-packages-mpy dist-packages

real    0m0.439s
user    0m0.152s
sys 0m0.247s

We hope you like this.

With kind regards, Andreas.

pfalcon commented 5 years ago

Thanks for your patch.

Pycopy is a principled project, with "right vs wrong" principles clearly (hopefully) described at https://github.com/pfalcon/pycopy#the-pycopy-zen .

This patch contradicts those principles on a few accounts:

Thus, it's not a good fit for Pycopy, sorry.