{ "info": { "author": "Benjamin Fogle", "author_email": "benfogle@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools" ], "description": "Virtual Envrionments for Cross-Compiling Python Extension Modules\n=============================================================================\n\nPorting a Python app to an embedded device can be complicated. Once you have\nPython built for your system, you may find yourself needing to include many\nthird-party libraries. Pure-Python libraries usually just work, but many\npopular libraries rely on compiled C code, which can be challenging to build.\n\nThis package is a tool for cross-compiling extension modules. It creates a\nspecial virtual environment such that ``pip`` or ``setup.py`` will cross\ncompile packages for you, usually with no further work on your part.\n\nIt can be used to:\n\n* Build binary wheels, for installation on target.\n* Install packages to a directory for upload or inclusion in a firmware image.\n\n**Note**: While this tool can cross-compile *most* Python packages, it can't\nsolve all the problems of cross-compiling. In some cases manual intervention\nmay still be necessary.\n\nThis tool requires Python 3.5 or higher (host and build). Significant work has\ngone into cross-compiling Python in newer versions, and many of the techniques\nneeded to do the cross compilation properly are not available on older\nreleases.\n\nThis tool currently only supports Linux build machines.\n\n\nVocabulary\n-----------------------------------------------------------------------------\n\n+---------------+------------------------------------------------------------+\n| Host | The machine you are building **for**. (Android, iOS, other |\n| | embedded systems.) |\n+---------------+------------------------------------------------------------+\n| Build | The machine you are building **on**. (Probably your |\n| | desktop.) |\n+---------------+------------------------------------------------------------+\n| Host-python | The compiled Python binary and libraries that run on Host |\n+---------------+------------------------------------------------------------+\n| Build-python | The compiled Python binary and libraries that run on |\n| | Build. |\n+---------------+------------------------------------------------------------+\n| Cross-python | Build-python, configured specially to build packages that |\n| | can be run with Host-python. This tool creates |\n| | Cross-python. |\n+---------------+------------------------------------------------------------+\n\n\nHow it works\n-----------------------------------------------------------------------------\n\nCross-python is set up carefully so that it reports all system information\nexactly as Host-python would. When done correctly, a side effect of this is\nthat ``distutils`` and ``setuptools`` will cross-compile when building\npackages. All of the normal packaging machinery still works correctly, so\ndependencies, ABI tags, and so forth all work as expected.\n\n\nRequirements\n-----------------------------------------------------------------------------\n\nYou will need:\n\n1. A version of Python (3.5 or later) that runs on Build. (Build-python.)\n2. A version of Python that will run on Host. (Host-python.) This must be the\n *same version* as Build-python.\n3. The cross-compiling toolchain used to make Host-python. Make sure you set\n PATH correctly to use it.\n4. Any libraries your modules depend on, cross-compiled and installed\n somewhere Cross-python can get to them. For example, the ``cryptography``\n package depends on OpenSSL and libffi.\n\n\nInstallation\n-----------------------------------------------------------------------------\n\nCrossenv can be installed using pip::\n\n $ pip install crossenv\n\n\nUsage\n-----------------------------------------------------------------------------\n\nTo create the virtual environment::\n\n $ /path/to/build/python3 -m crossenv /path/to/host/python3 venv\n\nThis creates a folder named ``venv`` that contains two subordinate virtual\nenvironments: one for Build-python, and one for Cross-python. When activated,\n``python`` (or its alias ``cross-python``) can be used for cross compiling. If\nneeded, packages can be installed on Build (e.g., a package requires Cython to\ninstall) with ``build-python``. There are equivalent ``pip``, ``cross-pip``,\nand ``build-pip`` commands.\n\nThe cross-compiler to use, along with any extra flags needed, are taken from\ninformation recorded when Host-python was compiled. To activate the\nenvironment::\n\n $ . venv/bin/activate\n\nYou can now see that ``python`` seems to think it's running on Host::\n\n (cross) $ python -m sysconfig\n ...\n\nNow you can cross compile! To install a package to\n``venv/cross/lib/python3.6/site-packages``, you can use pip directly::\n\n (cross) $ pip -v install numpy\n ...\n\nYou can use ``setup.py`` to build wheels::\n\n (cross) $ pip install wheel\n (cross) $ pip download numpy\n Collecting numpy\n Using cached numpy-1.14.1.zip\n Saved ./numpy-1.14.1.zip\n Successfully downloaded numpy\n (cross) $ unzip -q ./numpy-1.14.1.zip\n (cross) $ cd numpy-1.14.1\n (cross) $ python setup.py bdist_wheel\n ...\n\nWhen you need packages like Cython or cffi installed to build another module,\nsometimes satisfying dependencies can get tricky. If you simply ``pip install``\nthe module, you may find it builds Cython as a prerequisite *for the host* and\nthen tries to run it on the build machine. This will fail, of course, but if we\ninstall the necessary package for ``build-python``, then ``pip`` will pick up\nthe correct version during install.\n\nFor example, to build bcrypt and python-cryptography::\n\n (cross) $ build-pip install cffi\n (cross) $ pip install bcrypt\n (cross) $ pip install cryptography\n\nSome packages do explicit checks for existence of a package. For instance, a\npackage may do a check for Cython (other than simply trying to import it)\nbefore proceeding with installation. If a package is installed with\n``build-pip``, etc., then setuptools in ``cross-python`` does not recognize it\nas installed. (Note that you can still import it even if setuptools can't see\nit, so the naive check of ``import Cython`` will work fine so long as you did\n``build-pip install Cython`` earlier.) This is by design. To selectively expose\nbuild-python packages so that setuptools will count them as installed, you can\nuse the ``cross-expose`` script installed in the virtual environment.\n\nKnown Limitations\n-----------------------------------------------------------------------------\n\n* Upgrading ``cross-pip`` and ``build-pip`` must be done carefully, and it's\n best not to do so unless you need to. If you need to: upgrade ``cross-pip``\n first, then ``build-pip``.\n\n* When installing scripts, the shebang (``#!``) line is wrong. This will\n need to be fixed up before using on Host.\n\n* Any dependant libraries used during the build, such as OpenSSL, are *not*\n packaged in the wheel or install directory. You will need to ensure that\n these libraries are installed on Host and can be used. This is the normal\n Python behavior.\n\n* Any setup-time requirement listed in ``setup.py`` under ``setup_requires``\n will be installed in Cross-python's virtual environment, not Build-python.\n This will mostly work anyway if they are pure-Python, but for packages\n with extension modules (Cython, etc.), you will need to install them into\n Build-python's environment first. It's often a good idea to do a\n ``build-pip install `` prior to ``pip install ``.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/benfogle/crossenv", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "crossenv", "package_url": "https://pypi.org/project/crossenv/", "platform": "", "project_url": "https://pypi.org/project/crossenv/", "project_urls": { "Homepage": "https://github.com/benfogle/crossenv" }, "release_url": "https://pypi.org/project/crossenv/0.6/", "requires_dist": null, "requires_python": ">=3.4", "summary": "A cross-compiling tool for Python extension modules", "version": "0.6" }, "last_serial": 4738476, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "df55edeba1d2116f4f9944401fa11a98", "sha256": "c71ecf675b0bc45565c3ad5e3d01b685f4934567593f8f17f91b932fe3225a25" }, "downloads": -1, "filename": "crossenv-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "df55edeba1d2116f4f9944401fa11a98", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 19863, "upload_time": "2018-03-21T01:22:54", "url": "https://files.pythonhosted.org/packages/56/0a/1e7dc176d5b4f7d856b0d23efd2b5e96eaa4446168eb725059c396c5c5f9/crossenv-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a2b8ed65554a2f959e6f40ce8350c622", "sha256": "917f52211c4eb6a937d25bffb876a9af90de835b62343cf9572ae902ae0586b5" }, "downloads": -1, "filename": "crossenv-0.1.tar.gz", "has_sig": false, "md5_digest": "a2b8ed65554a2f959e6f40ce8350c622", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 14890, "upload_time": "2018-03-21T01:22:56", "url": "https://files.pythonhosted.org/packages/10/14/9d66bd9949775c2b1e1d72d215eeda7058b76c1ed0d41b88611fb7fb12f0/crossenv-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "620a15200bcac50f1c7d43faad9990ab", "sha256": "0e6f1dc7378da1800482053a478c3dd1dbb60386e1a68a8d0e1c1661009806fd" }, "downloads": -1, "filename": "crossenv-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "620a15200bcac50f1c7d43faad9990ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 17012, "upload_time": "2018-04-09T02:10:09", "url": "https://files.pythonhosted.org/packages/bb/77/16a8c3d64e65c5898541019c479047fa528d9ed79064221489814e4914b5/crossenv-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "766ad6041b60550d10c2fc4dce83a2d5", "sha256": "7de34ed1360c0093d4bd991164fc72a7728b7a1890f0c0ebe889e501007e9a78" }, "downloads": -1, "filename": "crossenv-0.2.tar.gz", "has_sig": false, "md5_digest": "766ad6041b60550d10c2fc4dce83a2d5", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 15226, "upload_time": "2018-04-09T02:10:10", "url": "https://files.pythonhosted.org/packages/d6/14/56c4bbaea16033992086a1247a6468deb6fecde63b2d77a53bb70610f1e5/crossenv-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "d5178dbfe4bfe818d489ca12f99029ca", "sha256": "b63e7fcac7b5b2315e24482614a6ef38dcf62b32074ef7afdf45866339e0d7f5" }, "downloads": -1, "filename": "crossenv-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "d5178dbfe4bfe818d489ca12f99029ca", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 17021, "upload_time": "2018-04-11T03:07:40", "url": "https://files.pythonhosted.org/packages/10/10/d4d2606f54dbf6896d6ac974638ed0e743ce612e8009cd56bf8a22c22a1a/crossenv-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9afc23790980dc34d3efba8c8f70ab47", "sha256": "2791894561c5bb118b1fbbdcd90d6dc0b421fe267de51d6df3d452557f417a5f" }, "downloads": -1, "filename": "crossenv-0.3.tar.gz", "has_sig": false, "md5_digest": "9afc23790980dc34d3efba8c8f70ab47", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 15234, "upload_time": "2018-04-11T03:07:41", "url": "https://files.pythonhosted.org/packages/c7/1d/b6bd62ceb6a4839953cfd8a077a24c1849d2b3e9849964080f5858a61c68/crossenv-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "06992f167ea5db3746e23d926322897c", "sha256": "de4082365dcae0cf57b8a1b1473ab7eae55ebdf5a577418136b2a70c861340fe" }, "downloads": -1, "filename": "crossenv-0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "06992f167ea5db3746e23d926322897c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 17167, "upload_time": "2018-07-21T03:11:39", "url": "https://files.pythonhosted.org/packages/45/e0/043ec79d47dcdd124c488a89fb735be41cf8fd51e0a66ee67fae5a034dbc/crossenv-0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce08aba56fb0b7f04f644c2255d834fd", "sha256": "0efa8f406a2490883ae238a9526fcb091b70e9b41e927ac0a8933ed3c35b361c" }, "downloads": -1, "filename": "crossenv-0.4.tar.gz", "has_sig": false, "md5_digest": "ce08aba56fb0b7f04f644c2255d834fd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 15380, "upload_time": "2018-07-21T03:11:40", "url": "https://files.pythonhosted.org/packages/21/94/bcaa706dfc920ecda0ce2fa1c75043bcb0a1b2676bd83aadb49e9956ca3e/crossenv-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "0c1b787794d3866084fef223727e508b", "sha256": "1259985b8309bd8384d1489fd3fbf0a8b165184a5bf0d481ae1a17ab2d9f53ad" }, "downloads": -1, "filename": "crossenv-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "0c1b787794d3866084fef223727e508b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 19249, "upload_time": "2018-11-30T04:36:11", "url": "https://files.pythonhosted.org/packages/c6/b1/304e028a756a52b803b1ca0fc9d15928c0a1d56cc36b41d4fd18d5bb609f/crossenv-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e61fc09e49ce8a0cf974ca6fafa5b2b1", "sha256": "baa8a08714820abf49bb66035f64c1d7e71ae4ac9014373d52b2493f70b2fc0e" }, "downloads": -1, "filename": "crossenv-0.5.tar.gz", "has_sig": false, "md5_digest": "e61fc09e49ce8a0cf974ca6fafa5b2b1", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 16801, "upload_time": "2018-11-30T04:36:13", "url": "https://files.pythonhosted.org/packages/32/40/818914cc25d977534e5cc6bca2eeed98db2ca4cb39e176da386f910773e6/crossenv-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "0a5fa535efc03224ea31fa04e5ca19da", "sha256": "3ee676cf8ab282e7c8f887ea36e2c51fe6cb01a0c61b5fb11e113e88da702545" }, "downloads": -1, "filename": "crossenv-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "0a5fa535efc03224ea31fa04e5ca19da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 19368, "upload_time": "2019-01-25T04:26:41", "url": "https://files.pythonhosted.org/packages/af/7a/2c84e379cc1f60ecebb26eaa380c46ddf2fc2fc9c79dbf5f6d73528fefe2/crossenv-0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "85606b0912c4bc3bf2892f77eddf1f51", "sha256": "e165785beb35d17aa0ce03472d5e41bc050d033de1f1703fb54a72bce5b059e9" }, "downloads": -1, "filename": "crossenv-0.6.tar.gz", "has_sig": false, "md5_digest": "85606b0912c4bc3bf2892f77eddf1f51", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19521, "upload_time": "2019-01-25T04:26:42", "url": "https://files.pythonhosted.org/packages/9d/5c/f34b4b85e86e69fe47b0af164c49d523511021023316a28a4dbd31a2a80b/crossenv-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0a5fa535efc03224ea31fa04e5ca19da", "sha256": "3ee676cf8ab282e7c8f887ea36e2c51fe6cb01a0c61b5fb11e113e88da702545" }, "downloads": -1, "filename": "crossenv-0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "0a5fa535efc03224ea31fa04e5ca19da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 19368, "upload_time": "2019-01-25T04:26:41", "url": "https://files.pythonhosted.org/packages/af/7a/2c84e379cc1f60ecebb26eaa380c46ddf2fc2fc9c79dbf5f6d73528fefe2/crossenv-0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "85606b0912c4bc3bf2892f77eddf1f51", "sha256": "e165785beb35d17aa0ce03472d5e41bc050d033de1f1703fb54a72bce5b059e9" }, "downloads": -1, "filename": "crossenv-0.6.tar.gz", "has_sig": false, "md5_digest": "85606b0912c4bc3bf2892f77eddf1f51", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 19521, "upload_time": "2019-01-25T04:26:42", "url": "https://files.pythonhosted.org/packages/9d/5c/f34b4b85e86e69fe47b0af164c49d523511021023316a28a4dbd31a2a80b/crossenv-0.6.tar.gz" } ] }