From 6a86b4a0adbe0ce1075fcf69a88f18d4c95b35ad Mon Sep 17 00:00:00 2001 From: Spencer Callicott Date: Tue, 27 Aug 2019 14:17:26 -0500 Subject: [PATCH 1/2] Fixed issue with setup.py where Pandas would fail to install without numpy previously installed. Affects Python 2.7 installs, and could install incorrect version in Python 3 installs as well. Also added build script for building pip wheels --- build-manylinux.sh | 9 +++++++++ build-wheels.sh | 18 ++++++++++++++++++ setup.py | 16 ++++++++++++---- 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100755 build-manylinux.sh create mode 100755 build-wheels.sh diff --git a/build-manylinux.sh b/build-manylinux.sh new file mode 100755 index 0000000000000..01e24bd32cf48 --- /dev/null +++ b/build-manylinux.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# + +docker run --rm -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh +ls wheelhouse/ +docker run --rm -e PLAT=manylinux1_i686 -v `pwd`:/io quay.io/pypa/manylinux1_i686 linux32 /io/build-wheels.sh +ls wheelhouse/ +docker run --rm -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/build-wheels.sh +ls wheelhouse/ \ No newline at end of file diff --git a/build-wheels.sh b/build-wheels.sh new file mode 100755 index 0000000000000..567c86141f91a --- /dev/null +++ b/build-wheels.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e -x + +# Compile wheels +for PYBIN in /opt/python/*/bin; do + "${PYBIN}/pip" install -r /io/requirements-dev.txt + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ +done + +# Bundle external shared libraries into the wheels +for whl in wheelhouse/*.whl; do + auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/ +done + +# Install packages and test +for PYBIN in /opt/python/*/bin/; do + "${PYBIN}/pip" install pandas27 --no-index -f /io/wheelhouse +done \ No newline at end of file diff --git a/setup.py b/setup.py index 2a67b21414f63..d57bcb600e438 100755 --- a/setup.py +++ b/setup.py @@ -31,13 +31,21 @@ def is_platform_mac(): min_numpy_ver = '1.12.0' +max_numpy_ver = '' + +numpy_install_rule = 'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver) + +if (sys.version_info < (3, 0)): + max_numpy_ver = '1.16.4' + numpy_install_rule += ', <= {numpy_ver}'.format(numpy_ver=max_numpy_ver) + setuptools_kwargs = { 'install_requires': [ 'python-dateutil >= 2.5.0', 'pytz >= 2011k', - 'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver), + numpy_install_rule, ], - 'setup_requires': ['numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)], + 'setup_requires': [numpy_install_rule], 'zip_safe': False, } @@ -727,9 +735,9 @@ def srcpath(name=None, suffix='.pyx', subdir='src'): # The build cache system does string matching below this point. # if you change something, be careful. -setup(name=DISTNAME, +setup(name='pandas27', maintainer=AUTHOR, - version=versioneer.get_version(), + version='0.24.3', packages=find_packages(include=['pandas', 'pandas.*']), package_data={'': ['templates/*', '_libs/*.dll']}, ext_modules=maybe_cythonize(extensions, compiler_directives=directives), From e7fc5e84b812c7da9be11d08e8adfb75281dcf49 Mon Sep 17 00:00:00 2001 From: Spencer Callicott Date: Wed, 28 Aug 2019 13:32:53 -0500 Subject: [PATCH 2/2] Auto build wheel files. --- build-manylinux.sh | 7 +------ build-wheels.sh | 14 +++++++++++--- dev-requirements.txt | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 dev-requirements.txt diff --git a/build-manylinux.sh b/build-manylinux.sh index 01e24bd32cf48..f98db2a9499b2 100755 --- a/build-manylinux.sh +++ b/build-manylinux.sh @@ -1,9 +1,4 @@ #!/bin/bash # -docker run --rm -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh -ls wheelhouse/ -docker run --rm -e PLAT=manylinux1_i686 -v `pwd`:/io quay.io/pypa/manylinux1_i686 linux32 /io/build-wheels.sh -ls wheelhouse/ -docker run --rm -e PLAT=manylinux2010_x86_64 -v `pwd`:/io quay.io/pypa/manylinux2010_x86_64 /io/build-wheels.sh -ls wheelhouse/ \ No newline at end of file +docker run -e PLAT=manylinux2010_x86_64 -v /home/callicott/work/pandas:/io quay.io/pypa/manylinux2010_x86_64 /io/build-wheels.sh \ No newline at end of file diff --git a/build-wheels.sh b/build-wheels.sh index 567c86141f91a..384952e68cf64 100755 --- a/build-wheels.sh +++ b/build-wheels.sh @@ -3,16 +3,24 @@ set -e -x # Compile wheels for PYBIN in /opt/python/*/bin; do - "${PYBIN}/pip" install -r /io/requirements-dev.txt - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + "${PYBIN}/pip" install -r /io/dev-requirements.txt & done +wait +for PYBIN in /opt/python/*/bin; do + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ & +done +wait + +ls wheelhouse # Bundle external shared libraries into the wheels for whl in wheelhouse/*.whl; do auditwheel repair "$whl" --plat $PLAT -w /io/wheelhouse/ done +ls /io/wheelhouse + # Install packages and test for PYBIN in /opt/python/*/bin/; do "${PYBIN}/pip" install pandas27 --no-index -f /io/wheelhouse -done \ No newline at end of file +done diff --git a/dev-requirements.txt b/dev-requirements.txt new file mode 100644 index 0000000000000..433197d34ac1e --- /dev/null +++ b/dev-requirements.txt @@ -0,0 +1,3 @@ +numpy>=1.13.3 +python-dateutil>=2.5.0 +pytz>=2015.4 \ No newline at end of file