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

Uploaded Python 2Python 3Windows x86-64

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

Uploaded Python 2Python 3Windows x86

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

Uploaded Python 2Python 3

mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded Python 2Python 3

mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux1_x86_64.whl (1.0 MB view details)

Uploaded Python 2Python 3

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

Uploaded Python 2Python 3

mpy_cross-1.26.0rc0.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.0rc0.post2-py2.py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 496ecaa6d64f642fc8b670078d0a10a20650c26c6b951d9b917ea313ff1d7f28
MD5 18677f518558537ca3d00eb4b60a4939
BLAKE2b-256 a89e5e842d79b586e2eca70331ba0f219795481636a03282a65969143dfe2f3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-win32.whl
Algorithm Hash digest
SHA256 aa5ab0f25825364fd3d7bebe3fec32726b6fc1eb4aae51d173ef047a1b797386
MD5 dadb9eb3ba85300aa9439a353fe79ec4
BLAKE2b-256 075d9bcfceb072d992d2574871834a5b7a1c3bc8aeb4b3e873d936e6e3e12053

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 70227c7952cc503c5d1923f009ddd95e61bf89b6ce0c8528d98fa094ec41aa01
MD5 d7e69d7a703e712e0c51fadf169ea7d4
BLAKE2b-256 d769b42eb186a665865b087cd757e2b2998746b6e48d8c7385ba9077b3a5beb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 005b207f8834534e332908e418d5ee358f7cd69d354f63e1b1cc9f11e921ad61
MD5 8a3c46d18bba8bdd4cc5e0f222c198eb
BLAKE2b-256 2bf0b49e80d42e55f9560fa3963ea117d33b28d5c923358dca1d0c16d80c91b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7710c719f9eff0be52ea90c2b9af8e21b272f5f62a747f27525a5293bc079b1c
MD5 a6d7372a80aad923730e42b4cafb8c3e
BLAKE2b-256 f35b6f0f72dd1e3e3d049af24c31fba17424c60726bc72802ac690b505a0ef8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-manylinux1_i686.whl
Algorithm Hash digest
SHA256 4ab3c179e1f05afb30d9ba82ba2e750bfb2eecd48173695dd288b64db327b6e7
MD5 8898cb9d8faa002343e1432dc4491658
BLAKE2b-256 079d68d43e7d1dadd127e321fded4c30a18943485c4d67d8b3fb9c2ff3577082

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mpy_cross-1.26.0rc0.post2-py2.py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 ac5ab24f99c46ec9f43ff788a4d728a7ef7f49ed765be444f91dfee405259510
MD5 59cfa4624ff3636166d4412ba27f455a
BLAKE2b-256 42c23c25bb71bfc6767f44468b03bfaa731b77f0998e75be8ce6c4e2bab387ec

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