Patched to be buildable on current build server jenkins-baltrad-db-418 jenkins-baltrad-db-419
authorAnders Henja <anders@baltrad.eu>
Wed, 13 Jun 2018 12:38:44 +0000 (14:38 +0200)
committerAnders Henja <anders@baltrad.eu>
Wed, 13 Jun 2018 12:38:44 +0000 (14:38 +0200)
client/python/setup.py
common/setup.py
misc/hudsonbuild.sh
misc/ssl_support_env.patch [new file with mode: 0644]
server/setup.py

index 1a3925b..fc65991 100755 (executable)
@@ -1,7 +1,4 @@
 #!/usr/bin/env python
-from ez_setup import use_setuptools
-use_setuptools(version="38.4.0")
-
 import setuptools
 import sys
 
index 0410e4b..ee72bba 100755 (executable)
@@ -1,8 +1,5 @@
 #!/usr/bin/env python
 
-from ez_setup import use_setuptools
-use_setuptools(version="38.4.0")
-
 import setuptools
 
 setuptools.setup(name="baltrad.bdbcommon",
index f5ee49f..a9af9b4 100644 (file)
@@ -1,8 +1,11 @@
 #!/bin/bash
 
 PROJECT_ROOT=$(dirname $(dirname $(readlink -f $0)))
-HLHDF_ROOT=/home/hudson/installed/baltrad_3p/hlhdf
-PREFIX=/home/hudson/installed/baltrad_3p/baltrad-db
+HLHDF_ROOT=/home/hudson/py27installation/hlhdf
+PREFIX=/home/hudson/py27installation/baltrad-db
+CERTIFI_PEM_FILE=
+#HLHDF_ROOT=/home/hudson/installed/baltrad_3p/hlhdf
+#PREFIX=/home/hudson/installed/baltrad_3p/baltrad-db
 
 create_env() {
   envpath=$1
@@ -21,6 +24,12 @@ init_env() {
 
   source $envpath/bin/activate
 
+  PATCHED_FILE=`$envpath/bin/python -c "from setuptools import ssl_support;print(ssl_support.__file__.replace(\".pyc\",\".py\"))"`
+  if [ "$PATCHED_FILE" != "" ]; then
+    patch "$PATCHED_FILE" < $PROJECT_ROOT/misc/ssl_support_env.patch
+  fi
+  CERTIFI_PEM_FILE=`$envpath/bin/python -c "from pip._vendor import certifi;print(certifi.where())"`
+  
   cp $HLHDF_ROOT/hlhdf.pth $envpath/lib/python2.7/site-packages
   export LD_LIBRARY_PATH=$HLHDF_ROOT/lib:$LD_LIBRARY_PATH
 }
@@ -40,15 +49,15 @@ install_python_package() {
   package_dir=$1
 
   cd $package_dir
-  python setup.py -q install
+  SSL_SUPPORT_OVERRIDE_PATH=$CERTIFI_PEM_FILE python setup.py -q install
 }
 
 test_python_package() {
   package_dir=$1
 
   cd $package_dir
-  python setup.py -q develop
-  python -m nose --first-package-wins --with-xunit --xunit-file=$package_dir/test-results.xml
+  SSL_SUPPORT_OVERRIDE_PATH=$CERTIFI_PEM_FILE python setup.py -q develop
+  SSL_SUPPORT_OVERRIDE_PATH=$CERTIFI_PEM_FILE python -m nose --first-package-wins --with-xunit --xunit-file=$package_dir/test-results.xml
 }
 
 test_java_client() {
@@ -60,7 +69,7 @@ test_java_client() {
 
 install_java_client() {
   cd "$PROJECT_ROOT/client/java"
-  ant install -Dprefix=$PREFIX
+  ant install -Dprefix="$PREFIX/env"
 }
 
 run_tests() {
diff --git a/misc/ssl_support_env.patch b/misc/ssl_support_env.patch
new file mode 100644 (file)
index 0000000..c40acab
--- /dev/null
@@ -0,0 +1,26 @@
+--- ssl_support.py.old 2018-06-13 12:52:21.566108979 +0200
++++ ssl_support.py     2018-06-13 13:02:59.197734100 +0200
+@@ -18,7 +18,13 @@
+     'opener_for'
+ ]
+-cert_paths = """
++ssl_support_cert_path=os.getenv("SSL_SUPPORT_OVERRIDE_PATH")
++if ssl_support_cert_path is None:
++    ssl_support_cert_path=""
++else:
++    ssl_support_cert_path = ssl_support_cert_path + "\n"
++
++cert_paths = (ssl_support_cert_path + """
+ /etc/pki/tls/certs/ca-bundle.crt
+ /etc/ssl/certs/ca-certificates.crt
+ /usr/share/ssl/certs/ca-bundle.crt
+@@ -27,7 +33,7 @@
+ /System/Library/OpenSSL/certs/cert.pem
+ /usr/local/share/certs/ca-root-nss.crt
+ /etc/ssl/ca-bundle.pem
+-""".strip().split()
++""").strip().split()
+ try:
+     HTTPSHandler = urllib.request.HTTPSHandler
index a6ca797..29ff1a8 100755 (executable)
@@ -1,7 +1,4 @@
 #!/usr/bin/env python
-from ez_setup import use_setuptools
-use_setuptools(version="38.4.0")
-
 import setuptools
 
 import sys
@@ -15,9 +12,9 @@ REQUIRED_PACKAGES= [
     "pycrypto >= 2.4",
     "python-daemon >= 1.6",
     "python-keyczar >= 0.7b",
-    "SQLAlchemy >= 1.0.13",
-    "sqlalchemy-migrate >= 0.10.0",
-    "werkzeug >= 0.14"
+    "SQLAlchemy >= 0.7",
+    "sqlalchemy-migrate >= 0.7.2",
+    "werkzeug >= 0.8"
 ]
 if sys.version_info > (3,):
     REQUIRED_PACKAGES= [