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.27.0rc0.post2-py2.py3-none-win_amd64.whl (1.2 MB view details)

Uploaded Python 2Python 3Windows x86-64

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

Uploaded Python 2Python 3Windows x86

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

Uploaded Python 2Python 3

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

Uploaded Python 2Python 3

mpy_cross-1.27.0rc0.post2-py2.py3-none-manylinux1_x86_64.whl (1.1 MB view details)

Uploaded Python 2Python 3

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

Uploaded Python 2Python 3

mpy_cross-1.27.0rc0.post2-py2.py3-none-macosx_11_0_universal2.whl (1.5 MB view details)

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

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6a55f9dd1454f5ea05e61b1607837fe69a5d4c2165f8b1f2bc93f8e94197fb4c
MD5 8a6977de21ece1d3993c29b3b69d705a
BLAKE2b-256 ee3943980f9234dde14344087bdc0c1ea91a42292bdbe2170b2f049d298828b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 77d9ab0e8493c9c4ae81be54b2f0c01f8e43c8ef75f0260a5958562b1bae6a76
MD5 222125e587fe591abe62972156f50c1d
BLAKE2b-256 4b30ea0d53fae72200b4ea358de70a36995b2407b9c4544d44b5f857f76a5cae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 323b138df4e7b36b58e8d6cb4b6eee1263f9edb6b1af9660585afd0664a57b03
MD5 6a75100532d5fe34b565608567a467eb
BLAKE2b-256 4d1dc637f93f38210778667dfd7fe8ea80cf12c7b2c0c1e2974eb742acd4149f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a18c967fb8cd942e130d10ea46970622aeaeeb11fb1b288b69c1a6d6f09488d6
MD5 420d3c8f8f816ec2e189c63ebcc7aea0
BLAKE2b-256 c4ea9ccbc6090c85c07ee9c4fca7850c272a8853034c61c46cb603b6bc5e3476

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0dc298a782a8f83ea6e42dffddea77d9b6994687346df9541ba30fb436efbeeb
MD5 e05b72162de06b22a5e01c282d52dee3
BLAKE2b-256 af3e04e55453bbc5655d8b78af1c9c40b7cf50a4d1353906036067787e8030f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 8e28377465e3362bc0b6947453122921abd8b99ad227974cd47faceb665b296b
MD5 e27f885b0bc9642731b0a2dd851bbc77
BLAKE2b-256 c8b7c0ec121291efdfca00a77cdf062d3f4f988a3f5f952c7c23c20bfd006e04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.27.0rc0.post2-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 e5493fcb5fb2fb6b5fa1c066cabf217f798598d2a9b6fbee3824821703eb8552
MD5 ce2747ab6ac8ac39b3b5b6e4d9daa4c9
BLAKE2b-256 58fcb97476da4a7c807be0a8245c20ac4db7517d9ef03e321417c4b21b9e0f74

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