Continuous integration with Travis CI
Created by: sciyoshi
@ovalhub this PR adds a Travis CI configuration file that automatically builds and runs unit tests for branches and PRs across various Python versions and architectures (currently only Linux). This is a nice sanity check that can give you some confidence that tests are passing when merging PRs.
This PR also builds manylinux1-compatible (aka PEP-513-compliant) wheels using the Docker image provided by that project, and uploads them to GitHub Releases for any git tags. As you noted in #39, PyICU is a C extension that can be built with any combination of ICU version, OS, architecture, and Python version, so cannot support so-called universal wheels. Wheels have a number of benefits that I won't get into here, however they lack the ability to declare platform tags. This has led to problems with our internal devpi mirror, where a wheel built on one distro and linked to a specific version of
libicu*.so.<ver> is cached and cannot be used on platforms with a different ICU version.
Short of re-writing PyICU using cffi/ctypes, PEP-513 provides a solution to this problem, achieving broad portability by restricting which external shared libraries the wheel is allowed to link to. This is done by bundling any external shared libraries and modifying
RPATH (similar to static linking), which is handled automatically by the auditwheel tool.
This approach comes with its own benefits and drawbacks, which are outlined in more detail in the PEP. In particular, PyICU releases would be tied to a specific version of ICU, rather than using the system-provided one. The situation would be much simpler if distros provided ABI-compatible versions of ICU with function renaming disabled, which for various reasons is not the case.
However, this opens up the possibility of synchronizing PyICU version numbers with upstream (e.g. pyicu==58.2 for ICU 58.2) and more easily publishing Windows and OSX packages that can be installed and used without a compiler.
Note that this patch also changes the tests to use six rather than 2to3 as a compatibility layer, which means that the tests will now only work on Python 2.6+ and Python 3.3+. Python 2.5 and below are not supported by Travis in any case, but this change is separate and could be reworked. (My editor also trimmed trailing spaces, but
?w=1 in the URL can hide that noise...)
In any case, let me know your thoughts. Thanks!