Skip to main content

micropython mpy-cross distribution

Project description

mpy-cross is the micropython cross compiler utility, used to pre-compile python files into bytecode (mpy files) suitable for running on your target.

For more details about mpy file / format see https://docs.micropython.org/en/latest/reference/mpyfiles.html

This project compiles mpy-cross for windows, linux and macos and distributes them in python wheels for easy installation on development pc’s:

pip install mpy-cross

Version

The release version of this package directly corresponds to the micropython release it’s built against.

If a wrapper update is needed for a particular release version, it will be updloaded with a .postN version

Weekly releases build against master should be available at: https://gitlab.com/alelec/mpy_cross/pipelines These will have version numbers that reflect the previous release and the current git hash built against.

Usage

mpy-cross package can be run in various different ways

  • As per normal mpy-cross app

    mpy-cross my_app.py
    mpy-cross --help
  • From python command line

    python -m mpy_cross <args>
    python -m mpy_cross --help
  • From python code

    import mpy_cross
    
    mpy_cross.run(*args, **kwargs)
    
    import subprocess
    proc = mpy_cross.run('--version', stdout=subprocess.PIPE)

where *args are arguments passed to mpy-cross, **kwargs are arguments to pass to subprocess.Popen() internally

  • Standalone

    # Print out path to actual mpy-cross binary
    python -c "import mpy_cross; print(mpy_cross.mpy_cross)"
    > /home/andrew/.local/share/virtualenvs/mpy_cross-gSGkki0d/lib/python3.5/site-packages/mpy_cross/mpy-cross
    /home/corona/.local/share/virtualenvs/mpy_cross-gSGkki0d/lib/python3.5/site-packages/mpy_cross/mpy-cross --version

Older Version Support

This package also supports running mpy-cross in compatibility mode to generage mpy files for older releases of micropython. Compatibility mode can be specified either by micropython version, eg.:

mpy-cross --compat 1.19 my_app.py

Or by specifying the bytecode version, eg:

mpy-cross --bytecode 6 my_app.py

mpy-cross options

usage: mpy-cross [<opts>] [-X <implopt>] [--] <input filename>
Options:
-c <version> : --compat <version> : Run mpy-cross in compatibility mode for given micropython version.
-b <version> : --bytecode <version> : Output specific bytecode version for use with older micropython versions.
--version : show version information
-o : output file for compiled bytecode (defaults to input filename with .mpy extension, or stdout if input is stdin)
-s : source filename to embed in the compiled bytecode (defaults to input file)
-v : verbose (trace various operations); can be multiple
-O[N] : apply bytecode optimizations of level N

Target specific options:
-msmall-int-bits=number : set the maximum bits used to encode a small-int
-march=<arch> : set architecture for native emitter;
                x86, x64, armv6, armv6m, armv7m, armv7em, armv7emsp, armv7emdp, xtensa, xtensawin, rv32imc, host, debug

Implementation specific options:
  emit={bytecode,native,viper} -- set the default code emitter
  heapsize=<n> -- set the heap size for the GC (default 2097152)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mpy_cross-1.26.1.post2-py2.py3-none-win_amd64.whl (1.2 MB view details)

Uploaded Python 2Python 3Windows x86-64

mpy_cross-1.26.1.post2-py2.py3-none-win32.whl (1.1 MB view details)

Uploaded Python 2Python 3Windows x86

mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_armv7l.whl (1.1 MB view details)

Uploaded Python 2Python 3

mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded Python 2Python 3

mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_x86_64.whl (923.7 kB view details)

Uploaded Python 2Python 3

mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_i686.whl (1.0 MB view details)

Uploaded Python 2Python 3

mpy_cross-1.26.1.post2-py2.py3-none-macosx_11_0_universal2.whl (1.8 MB view details)

Uploaded Python 2Python 3macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 8955b7721188ee73c0d22bd6f853fd19c50d9c443e16137c89d27070e47d62d4
MD5 a885bc4093612c6e30d00c3cac5fa340
BLAKE2b-256 8404f5c60e4ea47afa2394ec93b4205914311e87843edc33a19455c9fe31db6e

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-win32.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 17cd3f5fca205ea0f478466cf2e811fb995b245014588752d1ed4ae3391f054b
MD5 017cb03c62bd02e13c5dc1fc27fc61aa
BLAKE2b-256 54b37b6e9d5f8214b5da74dfb08211b04ed05a41480f34a166f44639e6997bcc

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2ffbdad8a12dd9f10c0a4309130ff84a76bb54ed13c65d54a610a221854eb056
MD5 d64a0dac943ad777b01178f00411e9d6
BLAKE2b-256 d316e23b3eb048f9b4823e1797b856d6eb571a85a3fda92c13dfb73c3d72084e

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e013864faadeef27e622b688b2a4556aa483a2daafebdaef81de453efc01019b
MD5 f1c0a6712cbfbf7227145f1ed4c01813
BLAKE2b-256 3c49f9669e36d9d5e552f7e19f5747909c93e1b37580707e8cc3a8c424ae1e64

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a21322a88412bff215daab2720d71de419792ff203501f4a1ed1b6a5e6e8d83e
MD5 182551add8db83d0d36fdce7624bdf5f
BLAKE2b-256 d1a84cf9aceeb5ce75f305004a4aec26809678b8b0c7037402e7d715c9dfb686

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_i686.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ce23cc77a9285ed7c3982a13614dd37971bcd5182c401b4e1441eaf0eed6cbcc
MD5 988be243506968caea23f4181f223992
BLAKE2b-256 79198c8510421582e572d8ff7b1e5681a77304e9b42f7a8cfc6f139caaf5090c

See more details on using hashes here.

File details

Details for the file mpy_cross-1.26.1.post2-py2.py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.1.post2-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 fbfb6fb22e4bd60d1f4fc09466efad5e2b0458ace68a47a189a8cca07a4c61ef
MD5 af217376707ef50327ba6e820d8c65e1
BLAKE2b-256 c3bbcd03c8c51c3348d4d70d4be7ff937db6a52fc7db801e948adc17a9ab6dd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page