From 7633be5ab0edb9a3ab625a68579159f167f1bc57 Mon Sep 17 00:00:00 2001 From: Kazuki Oikawa Date: Tue, 2 Jul 2019 00:43:53 +0900 Subject: [PATCH 1/6] Dropped Cython dependency from install_requires --- .travis.yml | 6 +++--- README.rst | 1 - requirements.txt | 1 - setup.py | 33 ++++++++++++++++----------------- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e6f3a4..073761b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,9 +61,9 @@ install: fi; fi - if [ "$DIST" == "centos" ] && [ $VERSION -eq 6 ]; then - docker exec test /usr/bin/scl enable python27 -- pip install --upgrade pip setuptools; + docker exec test /usr/bin/scl enable python27 -- pip install --upgrade pip setuptools cython; else - docker exec test pip install --upgrade pip setuptools; + docker exec test pip install --upgrade pip setuptools cython; fi - if [ "$TRAVIS_BRANCH" != "master" ]; then if [ "$DIST" == "centos" ]; then @@ -88,4 +88,4 @@ script: fi; elif [ "$DIST" == "ubuntu" ]; then docker exec -t test bash -ic "source /opt/jubatus/profile; pip install -e . && pip install scipy && python ./setup.py test"; - fi \ No newline at end of file + fi diff --git a/README.rst b/README.rst index a3cc098..9f0eb76 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,6 @@ Install :: - pip install Cython pip install embedded_jubatus Requirements diff --git a/requirements.txt b/requirements.txt index 7713793..cc3c29a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ -Cython>=0.27 numpy>=1.14 jubatus>=1.0.2 diff --git a/setup.py b/setup.py index a571ce8..4acc001 100644 --- a/setup.py +++ b/setup.py @@ -13,9 +13,8 @@ def read(name): def _setup(): include_dirs = [] install_requires = read('requirements.txt').split('\n') - build_requires = [ - line for line in install_requires - if line.startswith('numpy') or line.startswith('Cython')] + setup_requires = ['Cython'] + [ + row for row in install_requires if row.startswith('numpy')] try: from Cython.Build import cythonize @@ -51,24 +50,24 @@ def _setup(): 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', ], - build_requires=build_requires, + setup_requires=setup_requires, install_requires=install_requires, test_suite='tests', ) + kwargs['ext_modules'] = [Extension( + 'embedded_jubatus', [ + 'src/embedded_jubatus.{}'.format( + 'pyx' if cythonize else 'cpp'), + 'src/_wrapper.cpp', + 'src/_model.cpp' + ], + include_dirs=include_dirs, + libraries=['jubatus_core', 'jubatus_util_text'], + language='c++', + extra_compile_args=extra_compile_args) + ] if cythonize: - kwargs['ext_modules'] = cythonize([ - Extension( - 'embedded_jubatus', - [ - 'src/embedded_jubatus.pyx', - 'src/_wrapper.cpp', - 'src/_model.cpp' - ], - include_dirs=include_dirs, - libraries=['jubatus_core', 'jubatus_util_text'], - language='c++', - extra_compile_args=extra_compile_args) - ]) + kwargs['ext_modules'] = cythonize(kwargs['ext_modules']) setup(**kwargs) From d0bd53baa097e12c34355b290ae1f01c1273d7cb Mon Sep 17 00:00:00 2001 From: Kazuki OIKAWA Date: Tue, 2 Jul 2019 08:25:16 +0900 Subject: [PATCH 2/6] Fixed numpy version limits to support python 2.x --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cc3c29a..7780b18 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -numpy>=1.14 +numpy>=1.14,<1.17.0 # numpy-1.17.0 dropped python2 supports jubatus>=1.0.2 From 17331440d0c4f789315f1b825c7341414556eadb Mon Sep 17 00:00:00 2001 From: Kazuki Oikawa Date: Tue, 2 Jul 2019 01:17:29 +0900 Subject: [PATCH 3/6] Added a script to build manylinux2010 wheel package --- .travis.yml | 18 ++++++++++-------- README.rst | 4 ++-- build-wheels.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 10 deletions(-) create mode 100755 build-wheels.sh diff --git a/.travis.yml b/.travis.yml index 073761b..cab7055 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,11 +20,13 @@ matrix: - env: - DIST=ubuntu - VERSION=16.04 + - env: + - DIST=quay.io/pypa/manylinux2010_x86_64 + - VERSION=latest before_install: - docker pull ${DIST}:${VERSION} - - docker run -w /root --name test -d ${DIST}:${VERSION} sleep infinity - - docker cp . test:/root/ + - docker run -v $(pwd):/io -w /io --name test -d ${DIST}:${VERSION} sleep infinity - if [ "$DIST" == "centos" ]; then if [ $VERSION -eq 6 ]; then docker exec test rpm -Uvh http://download.jubat.us/yum/rhel/6/stable/x86_64/jubatus-release-6-2.el6.x86_64.rpm; @@ -62,19 +64,17 @@ install: fi - if [ "$DIST" == "centos" ] && [ $VERSION -eq 6 ]; then docker exec test /usr/bin/scl enable python27 -- pip install --upgrade pip setuptools cython; - else + elif [ "$DIST" != "quay.io/pypa/manylinux2010_x86_64" ]; then docker exec test pip install --upgrade pip setuptools cython; fi - if [ "$TRAVIS_BRANCH" != "master" ]; then if [ "$DIST" == "centos" ]; then docker exec test yum -y install git bzip2 msgpack-devel-0.5.9; - elif [ "$DIST" == "ubuntu" ]; then - docker exec test apt-get --force-yes -y install git bzip2 libmsgpack-dev; - fi; - docker exec test git clone -b develop https://github.com/jubatus/jubatus_core.git; - if [ "$DIST" == "centos" ]; then + docker exec test git clone -b develop https://github.com/jubatus/jubatus_core.git; docker exec test bash -ic "cd jubatus_core; ./waf configure --prefix=/usr --regexp-library=none && ./waf build && ./waf install && ldconfig"; elif [ "$DIST" == "ubuntu" ]; then + docker exec test apt-get --force-yes -y install git bzip2 libmsgpack-dev; + docker exec test git clone -b develop https://github.com/jubatus/jubatus_core.git; docker exec test bash -ic "cd jubatus_core; ./waf configure --prefix=/usr --regexp-library=none && ./waf build && ./waf install"; fi; fi @@ -88,4 +88,6 @@ script: fi; elif [ "$DIST" == "ubuntu" ]; then docker exec -t test bash -ic "source /opt/jubatus/profile; pip install -e . && pip install scipy && python ./setup.py test"; + elif [ "$DIST" == "quay.io/pypa/manylinux2010_x86_64" ]; then + docker exec -t test bash build-wheels.sh build_wheels; fi diff --git a/README.rst b/README.rst index 9f0eb76..6b6449f 100644 --- a/README.rst +++ b/README.rst @@ -24,8 +24,8 @@ Install Requirements ------------ -* Python 2.7, 3.3, 3.4 or 3.5. -* `Jubatus `_ needs to be installed. +* Python 2.7, 3.3, 3.4, 3.5, 3.6 or 3.7. +* `Jubatus `_ needs to be installed when build from sources. Limitations ----------- diff --git a/build-wheels.sh b/build-wheels.sh new file mode 100755 index 0000000..d350a73 --- /dev/null +++ b/build-wheels.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -e -x + +function build_wheels() { + if [ -z "${JUBATUS_VERSION}" ]; then + JUBATUS_VERSION=${TRAVIS_TAG:-master} + fi + + rpm -Uvh http://download.jubat.us/yum/rhel/6/stable/x86_64/jubatus-release-6-2.el6.x86_64.rpm + yum install -y msgpack-devel oniguruma-devel + + curl -OL https://github.com/jubatus/jubatus_core/archive/${JUBATUS_VERSION}.tar.gz + tar xf ${JUBATUS_VERSION}.tar.gz + cd jubatus_core-${JUBATUS_VERSION} + ./waf configure --prefix=/usr + ./waf build + ./waf install + cd /io + + for PYBIN in /opt/python/*m/bin; do + "${PYBIN}/pip" install cython + "${PYBIN}/pip" install -r /io/requirements.txt + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + done + + for whl in wheelhouse/*.whl; do + auditwheel repair "$whl" --plat manylinux2010_x86_64 -w /io/wheelhouse/ + done + + /opt/python/cp37-cp37m/bin/python ./setup.py sdist + + for PYBIN in /opt/python/*m/bin; do + V=${PYBIN%/bin} + V=${V#/opt/python/} + "${PYBIN}/pip" install /io/wheelhouse/embedded_jubatus-*-${V}-manylinux2010_x86_64.whl scipy + "${PYBIN}/python" ./setup.py test + done +} + +if [ "$1" = "build_wheels" ]; then + build_wheels +else + docker pull quay.io/pypa/manylinux2010_x86_64 + docker run --rm \ + -e JUBATUS_VERSION=${JUBATUS_VERSION} \ + -e TRAVIS_TAG=${TRAVIS_TAG} \ + -v $(pwd):/io \ + quay.io/pypa/manylinux2010_x86_64 \ + /io/build-wheels.sh build_wheels +fi From e1529cb13f59aba775f35d76428e8409b067760d Mon Sep 17 00:00:00 2001 From: Kazuki OIKAWA Date: Tue, 16 Jul 2019 22:27:32 +0900 Subject: [PATCH 4/6] Add description of required library and version --- README.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 6b6449f..f9fed43 100644 --- a/README.rst +++ b/README.rst @@ -24,8 +24,11 @@ Install Requirements ------------ -* Python 2.7, 3.3, 3.4, 3.5, 3.6 or 3.7. -* `Jubatus `_ needs to be installed when build from sources. +* Python 2.7, 3.5, 3.6 or 3.7 +* `Jubatus (Python Client) `_ 1.0.2 or later +* numpy 1.14-1.16 (1.17 or later don't support Python 2.7) +* `Jubatus `_ needs to be installed when build from source package or repository +* `Cython `_ needs to be installed when build from repository Limitations ----------- From d9b2c46c67ae9646ac09d6d52af4b40c97d2e306 Mon Sep 17 00:00:00 2001 From: Kazuki OIKAWA Date: Mon, 29 Jul 2019 13:33:03 +0900 Subject: [PATCH 5/6] Fixed numpy version requirements * There is no binary compatibility between numpy<1.16.0 and numpy>=1.16.0. manylinux2010 package not work on numpy<1.16.0 because build on numpy-1.16. Fixes lower version requirements. * Removes upper version limits in requirements because no problems on python 2.7 if removed upper limits. --- .travis.yml | 6 +++--- build-wheels.sh | 7 ++++--- requirements.txt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index cab7055..10113ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,12 +82,12 @@ install: script: - if [ "$DIST" == "centos" ]; then if [ $VERSION -eq 6 ]; then - docker exec -t test /usr/bin/scl enable python27 -- bash -ic "pip install -e . && pip install scipy && python ./setup.py test"; + docker exec -t test /usr/bin/scl enable python27 -- bash -ic "pip install -r requirements.txt && pip install -e . && pip install scipy && python ./setup.py test"; else - docker exec -t test bash -ic "pip install -e . && pip install scipy && python ./setup.py test"; + docker exec -t test bash -ic "pip install -r requirements.txt && pip install -e . && pip install scipy && python ./setup.py test"; fi; elif [ "$DIST" == "ubuntu" ]; then - docker exec -t test bash -ic "source /opt/jubatus/profile; pip install -e . && pip install scipy && python ./setup.py test"; + docker exec -t test bash -ic "source /opt/jubatus/profile; pip install -r requirements.txt && pip install -e . && pip install scipy && python ./setup.py test"; elif [ "$DIST" == "quay.io/pypa/manylinux2010_x86_64" ]; then docker exec -t test bash build-wheels.sh build_wheels; fi diff --git a/build-wheels.sh b/build-wheels.sh index d350a73..2ada946 100755 --- a/build-wheels.sh +++ b/build-wheels.sh @@ -17,7 +17,7 @@ function build_wheels() { ./waf install cd /io - for PYBIN in /opt/python/*m/bin; do + for PYBIN in /opt/python/*/bin; do "${PYBIN}/pip" install cython "${PYBIN}/pip" install -r /io/requirements.txt "${PYBIN}/pip" wheel /io/ -w wheelhouse/ @@ -29,11 +29,12 @@ function build_wheels() { /opt/python/cp37-cp37m/bin/python ./setup.py sdist - for PYBIN in /opt/python/*m/bin; do + cd /io/tests + for PYBIN in /opt/python/*/bin; do V=${PYBIN%/bin} V=${V#/opt/python/} "${PYBIN}/pip" install /io/wheelhouse/embedded_jubatus-*-${V}-manylinux2010_x86_64.whl scipy - "${PYBIN}/python" ./setup.py test + "${PYBIN}/python" -m unittest discover -v done } diff --git a/requirements.txt b/requirements.txt index 7780b18..bfcb1ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -numpy>=1.14,<1.17.0 # numpy-1.17.0 dropped python2 supports +numpy>=1.16 jubatus>=1.0.2 From fd6fb80faec1a03325170ff4dfb17f34a7cf60db Mon Sep 17 00:00:00 2001 From: Tetsuya Shioda Date: Tue, 30 Jul 2019 12:27:57 +0900 Subject: [PATCH 6/6] bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 0c39c61..7b1329e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.1-p1 +1.1.1.post2