From 0dee17edd4f0d26b8ee7012273567a8f65e77501 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszek Date: Fri, 4 Mar 2022 10:37:31 +0100 Subject: [PATCH] Add support for installing clidriver using another URL or artifactory URL. --- IBM_DB/ibm_db/setup.py | 5 ++++- README.md | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/IBM_DB/ibm_db/setup.py b/IBM_DB/ibm_db/setup.py index e43df5ad..3c11efdc 100644 --- a/IBM_DB/ibm_db/setup.py +++ b/IBM_DB/ibm_db/setup.py @@ -235,7 +235,10 @@ def _setDllPath(): ibm_db_lib = os.path.join(ibm_db_dir, 'lib') if not os.path.isdir('clidriver'): - url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName + if 'IBM_DB_INSTALLER_URL' in os.environ: + url = os.getenv('IBM_DB_INSTALLER_URL') + cliFileName + else: + url = 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/' + cliFileName sys.stdout.write("Downloading %s\n" % (url)) sys.stdout.flush(); file_stream = BytesIO(request.urlopen(url, context=context).read()) diff --git a/README.md b/README.md index 4d143a38..16eed92a 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,11 @@ pip install ibm_db ``` This will install ibm_db and ibm_db_dbi module. +If you have to use your own URL for clidriver please set environment variable +``` +IBM_DB_INSTALLER_URL +``` + If you are using python 3.8 or 3.9 on windows and building the source manually, you will need to set dll path of dependent library of clidriver before importing the module as: ``` import os