From 2abc9646e18f7fca2c49d0d1c9a749bd97f40884 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 10:23:41 -0500 Subject: [PATCH 01/11] Fix OSX setup --- setup.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 04d15097..7afc414e 100644 --- a/setup.py +++ b/setup.py @@ -119,12 +119,7 @@ def compile_native_invocation_handler(*possible_homes): )] else: LIB_LOCATION = 'jre/lib/server/libjvm.dylib' - - if isinstance(JRE_HOME, bytes): - JAVA_HOME = dirname(JRE_HOME.decode()) - else: - JAVA_HOME = dirname(JRE_HOME) - FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION) + FULL_LIB_LOCATION = join(FRAMEWORK, LIB_LOCATION) if not exists(FULL_LIB_LOCATION): # In that case, the Java version is very likely >=9. From 00d0cff418adb1b4b16e7e0ae4496e87bfb658e4 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 10:48:51 -0500 Subject: [PATCH 02/11] OSX on Travis --- .travis.yml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 339a63bb..f8e0b256 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,9 +70,70 @@ matrix: - PYTHON_VERSION="3.7" - JAVA_VERSION="11" + - language: python + os: osx + env: + - PYTHON_VERSION="2.7" + - JAVA_VERSION="8" + - language: python + os: osx + env: + - PYTHON_VERSION="3.6" + - JAVA_VERSION="8" + - language: python + os: osx + env: + - PYTHON_VERSION="3.7" + - JAVA_VERSION="8" + - language: python + os: osx + env: + - PYTHON_VERSION="2.7" + - JAVA_VERSION="9" + - language: python + os: osx + env: + - PYTHON_VERSION="3.6" + - JAVA_VERSION="9" + - language: python + os: osx + env: + - PYTHON_VERSION="3.7" + - JAVA_VERSION="9" + - language: python + os: osx + env: + - PYTHON_VERSION="2.7" + - JAVA_VERSION="10" + - language: python + os: osx + env: + - PYTHON_VERSION="3.6" + - JAVA_VERSION="10" + - language: python + os: osx + env: + - PYTHON_VERSION="3.7" + - JAVA_VERSION="10" + - language: python + os: osx + env: + - PYTHON_VERSION="2.7" + - JAVA_VERSION="11" + - language: python + os: osx + env: + - PYTHON_VERSION="3.6" + - JAVA_VERSION="11" + - language: python + os: osx + env: + - PYTHON_VERSION="3.7" + - JAVA_VERSION="11" + + install: - - sudo apt-get update - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - echo ". $HOME/miniconda/etc/profile.d/conda.sh" >> $HOME/.bashrc From d4c1af672cbf448e016ed0636f335d638aebf2ec Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:04:12 -0500 Subject: [PATCH 03/11] Use generic --- .travis.yml | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index f8e0b256..f3a26528 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,131 +1,131 @@ -language: python +language: generic matrix: fast_finish: true include: - - language: python + - language: generic os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="8" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="8" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="8" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="8" - RUN=sdist - - language: python + - language: generic os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="9" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="9" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="9" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="10" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="10" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="10" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="11" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="11" - - language: python + - language: generic os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="11" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="8" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="8" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="8" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="9" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="9" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="9" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="10" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="10" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="10" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="11" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="11" - - language: python + - language: generic os: osx env: - PYTHON_VERSION="3.7" From 3672929f0094d790622e4e323fd284fccfc5c8fb Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:06:51 -0500 Subject: [PATCH 04/11] Travis: osx first --- .travis.yml | 85 ++++++++++++++++++----------------------------------- 1 file changed, 29 insertions(+), 56 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3a26528..38a39807 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,136 +3,109 @@ language: generic matrix: fast_finish: true include: - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="8" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="8" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="8" - - language: generic - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="8" - - RUN=sdist - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="9" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="9" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="9" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="10" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="10" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="10" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="2.7" - JAVA_VERSION="11" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.6" - JAVA_VERSION="11" - - language: generic - os: linux + - os: osx env: - PYTHON_VERSION="3.7" - JAVA_VERSION="11" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="8" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="8" - - language: generic - os: osx + - os: linux + env: + - PYTHON_VERSION="3.7" + - JAVA_VERSION="8" + - os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="8" - - language: generic - os: osx + - RUN=sdist + - os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="9" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="9" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="9" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="10" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="10" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="10" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="2.7" - JAVA_VERSION="11" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.6" - JAVA_VERSION="11" - - language: generic - os: osx + - os: linux env: - PYTHON_VERSION="3.7" - JAVA_VERSION="11" - - install: - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda From 05a67abf160821a16df43e2d2fcd1942c55ae4e3 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:09:39 -0500 Subject: [PATCH 05/11] Get correct miniconda version in Travis --- .travis.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 38a39807..8ebe7c8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,7 +107,14 @@ matrix: - JAVA_VERSION="11" install: - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh + + - if [ "$TRAVIS_OS_NAME" = linux ]; then + sudo apt-get update + MINICONDAVERSION="Linux" + else + MINICONDAVERSION="MacOSX" + fi + - wget https://repo.continuum.io/miniconda/Miniconda3-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - echo ". $HOME/miniconda/etc/profile.d/conda.sh" >> $HOME/.bashrc - source $HOME/.bashrc From 1872a80099b3afc60ae7f179a90b60a6ab8b9150 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:14:05 -0500 Subject: [PATCH 06/11] Ix Travis again --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ebe7c8f..5cee16e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,11 +109,11 @@ matrix: install: - if [ "$TRAVIS_OS_NAME" = linux ]; then - sudo apt-get update - MINICONDAVERSION="Linux" + sudo apt-get update; + MINICONDAVERSION="Linux"; else - MINICONDAVERSION="MacOSX" - fi + MINICONDAVERSION="MacOSX"; + fi; - wget https://repo.continuum.io/miniconda/Miniconda3-latest-$MINICONDAVERSION-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - echo ". $HOME/miniconda/etc/profile.d/conda.sh" >> $HOME/.bashrc From a8cdd7be75bfeea34c0023e943d08f15f14f4253 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:40:41 -0500 Subject: [PATCH 07/11] Make travis less verbose --- .travis.yml | 121 ++++++++-------------------------------------------- 1 file changed, 18 insertions(+), 103 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5cee16e8..9b576781 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,110 +1,25 @@ language: generic +os: + - linux + - osx + +env: + - PYTHON_VERSION="2.7" JAVA_VERSION="8" + - PYTHON_VERSION="3.6" JAVA_VERSION="8" + - PYTHON_VERSION="3.7" JAVA_VERSION="8" + - PYTHON_VERSION="2.7" JAVA_VERSION="9" + - PYTHON_VERSION="3.6" JAVA_VERSION="9" + - PYTHON_VERSION="3.7" JAVA_VERSION="9" + - PYTHON_VERSION="2.7" JAVA_VERSION="10" + - PYTHON_VERSION="3.6" JAVA_VERSION="10" + - PYTHON_VERSION="3.7" JAVA_VERSION="10" + - PYTHON_VERSION="2.7" JAVA_VERSION="11" + - PYTHON_VERSION="3.6" JAVA_VERSION="11" + - PYTHON_VERSION="3.7" JAVA_VERSION="11" + matrix: fast_finish: true - include: - - os: osx - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="8" - - os: osx - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="8" - - os: osx - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="8" - - os: osx - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="9" - - os: osx - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="9" - - os: osx - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="9" - - os: osx - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="10" - - os: osx - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="10" - - os: osx - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="10" - - os: osx - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="11" - - os: osx - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="11" - - os: osx - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="11" - - - os: linux - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="8" - - os: linux - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="8" - - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="8" - - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="8" - - RUN=sdist - - os: linux - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="9" - - os: linux - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="9" - - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="9" - - os: linux - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="10" - - os: linux - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="10" - - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="10" - - os: linux - env: - - PYTHON_VERSION="2.7" - - JAVA_VERSION="11" - - os: linux - env: - - PYTHON_VERSION="3.6" - - JAVA_VERSION="11" - - os: linux - env: - - PYTHON_VERSION="3.7" - - JAVA_VERSION="11" install: From 2e882d40cef1ac475851f5f18cf68732f1002359 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 11:41:34 -0500 Subject: [PATCH 08/11] Travis osx first --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b576781..ac30952a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: generic os: - - linux - osx + - linux env: - PYTHON_VERSION="2.7" JAVA_VERSION="8" From aae2c5779a20385a52a755fb84dadedd69b6b128 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 12:11:18 -0500 Subject: [PATCH 09/11] Disable Java 8/OSX --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index ac30952a..4fdea0cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,13 @@ env: matrix: fast_finish: true + exclude: + - os: osx + env: PYTHON_VERSION="2.7" JAVA_VERSION="8" + - os: osx + env: PYTHON_VERSION="3.6" JAVA_VERSION="8" + - os: osx + env: PYTHON_VERSION="3.7" JAVA_VERSION="8" install: From 5cda4258847a8d47c4b04ee1de3627132355b510 Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 12:22:30 -0500 Subject: [PATCH 10/11] Use JAVA_HOME for osx --- .travis.yml | 7 ------- setup.py | 9 ++++++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4fdea0cf..ac30952a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,13 +20,6 @@ env: matrix: fast_finish: true - exclude: - - os: osx - env: PYTHON_VERSION="2.7" JAVA_VERSION="8" - - os: osx - env: PYTHON_VERSION="3.6" JAVA_VERSION="8" - - os: osx - env: PYTHON_VERSION="3.7" JAVA_VERSION="8" install: diff --git a/setup.py b/setup.py index 7afc414e..1931d284 100644 --- a/setup.py +++ b/setup.py @@ -122,9 +122,12 @@ def compile_native_invocation_handler(*possible_homes): FULL_LIB_LOCATION = join(FRAMEWORK, LIB_LOCATION) if not exists(FULL_LIB_LOCATION): - # In that case, the Java version is very likely >=9. - # So we need to modify the `libjvm.so` path. - LIB_LOCATION = 'lib/server/libjvm.dylib' + JAVA_HOME = getenv('JAVA_HOME') + FULL_LIB_LOCATION = join(FRAMEWORK, LIB_LOCATION) + if not exists(FULL_LIB_LOCATION): + # In that case, the Java version is very likely >=9. + # So we need to modify the `libjvm.so` path. + LIB_LOCATION = 'lib/server/libjvm.dylib' INCLUDE_DIRS = [ '{0}/include'.format(FRAMEWORK), From 537517fbd07141a8173e94f2b8a74201d1b34ebc Mon Sep 17 00:00:00 2001 From: Hadrien Mary Date: Sat, 24 Nov 2018 12:48:36 -0500 Subject: [PATCH 11/11] Fix mistake in variables --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1931d284..b7c81393 100644 --- a/setup.py +++ b/setup.py @@ -123,7 +123,7 @@ def compile_native_invocation_handler(*possible_homes): if not exists(FULL_LIB_LOCATION): JAVA_HOME = getenv('JAVA_HOME') - FULL_LIB_LOCATION = join(FRAMEWORK, LIB_LOCATION) + FULL_LIB_LOCATION = join(JAVA_HOME, LIB_LOCATION) if not exists(FULL_LIB_LOCATION): # In that case, the Java version is very likely >=9. # So we need to modify the `libjvm.so` path. @@ -208,6 +208,10 @@ def compile_native_invocation_handler(*possible_homes): ] if PLATFORM == 'win32': + + if isinstance(JRE_HOME, bytes): + JRE_HOME = JRE_HOME.decode() + LIBRARY_DIRS = [ join(JDK_HOME, 'lib'), join(JRE_HOME, 'bin', 'server')