Skip to main content

Repackage python-flint to include arb and flint as shared libraries

Project description

flint-py

This is a repackaged version of python-flint by Fredrik Johansson. The original package requires that the user first installs Flint and Arb, which in turn require gmp and mpfr to be installed as well. This sometimes is problematic because not every distribution has suitable packages of these libraries.

The alternative is to prebuilt different versions of the required libraries and to ship them with the python package. This repository achieves exactly that goal by leveraging PEP 513 and the manylinux project.

So, if you were planning to depend on python-flint and build the required dependencies by hand, you could try flint-py instead and see if it just works.

How to build wheels?

For the future maintainers of flint-py, here is a rough outline of the wheel build procedure:

  1. Select the desired versions of the mpir, mpfr, flint and arb libraries in the ext directory. Note that mpir, mpfr and flint are submodules, so you could check out any commit or tag that you might like. As for the mpfr library, please download a release and manually commit it into git here.

  2. Build the docker image and run it as a container:

    cd flint-py
    docker build --tag flint-py
    docker run flint-py:latest
    
  3. Find out the id of the container and copy the wheels out of it:

    docker container ls -a #find the correct id
    docker cp <container_id>:/flint-py/wheelhouse ./wheelhouse
    
  4. At this point, the ./wheelhouse directory on your local filesystem should contain the wheels you need, e.g.

    ls ./wheelhouse
    flint_py-0.3.4-cp27-cp27mu-manylinux1_x86_64.whl  flint_py-0.3.4-cp35-cp35m-manylinux1_x86_64.whl
    flint_py-0.3.4-cp27-cp27m-manylinux1_x86_64.whl   flint_py-0.3.4-cp36-cp36m-manylinux1_x86_64.whl
    flint_py-0.3.4-cp34-cp34m-manylinux1_x86_64.whl   flint_py-0.3.4-cp37-cp37m-manylinux1_x86_64.whl
    
  5. Upload the wheels to pypi:

    twine upload ./wheelhouse/*
    

Common pitfalls

  1. If you are trying to debug the compilation of C libraries under ext, please keep in mind that when you switch to docker builds, your build artifacts from the local filesystem will be copied into the image. This could break the docker build in unexpected ways. To avoid that, you could either carefully remove the artifacts before running docker or you could conduct local builds in a copy of the project.

  2. Cython extensions are not automatically rebuilt, which causes some problems for Python2.7. Currently, the build_wheels.sh script removes the extension artifacts each time before cython is asked to rebuild them in docker.

  3. If you are running Arch Linux and your docker container seems to crash with error code 139 for any command that you run, enable vsyscall=emulate for your kernel. See https://wiki.archlinux.org/index.php/Docker#Installation

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

flint_py-0.3.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (22.3 MB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (21.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (21.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (22.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp38-cp38-manylinux2010_x86_64.whl (22.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp37-cp37m-manylinux2010_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp36-cp36m-manylinux2010_x86_64.whl (21.7 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp35-cp35m-manylinux2010_x86_64.whl (21.6 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp34-cp34m-manylinux2010_x86_64.whl (21.7 MB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp27-cp27mu-manylinux2010_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

flint_py-0.3.7-cp27-cp27m-manylinux2010_x86_64.whl (21.3 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

Supported by

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