1616# This is the only place where package version number is set!
1717# The version should correspond to PEP440 and gets normalised if
1818# not in the right format. VRM can be followed with a|b|rc with a further numeric
19- # to indicate alpha/beta/release candidate versions.
19+ # to indicate alpha/beta/release- candidate versions.
2020VERSION = '2.0.0b2'
2121
2222# If the MQ SDK is in a non-default location, set MQ_FILE_PATH environment variable.
23- # If that env var is not set, then use a default root of the current directory (which
24- # might not be necessary, but shouldn't do any harm.
2523custom_path = os .environ .get ('MQ_FILE_PATH' , None )
2624
2725# Always build in 64-bit mode. And use libmqm regardless of whether the package
3129 # Seems the closest exception (now an alias of EnvironmentError)
3230 raise OSError ("Cannot build in 32-bit mode. Only 64-bit systems supported." )
3331
32+ # The include_dirs and library_dirs used to be lists that always included the default
33+ # directories. But if you've gone to the trouble of setting a non-default
34+ # custom_path, then we should only use that. Otherwise the compile might get confused and use
35+ # the "wrong" version of the files.
36+
3437def get_windows_settings ():
3538 """ Windows settings.
3639 """
3740
38- library_dirs = [r'c:\Program Files\IBM\MQ\tools\Lib64' ]
3941 include_dirs = [r'c:\Program Files\IBM\MQ\tools\c\include' ]
42+ library_dirs = [r'c:\Program Files\IBM\MQ\tools\Lib64' ]
4043 if custom_path :
41- library_dirs . append ( r'{}\tools\Lib64' .format (custom_path ))
42- include_dirs . append ( r'{}\tools\c\include' .format (custom_path ))
44+ library_dirs = [ r'{}\tools\Lib64' .format (custom_path )]
45+ include_dirs = [ r'{}\tools\c\include' .format (custom_path )]
4346
4447 libraries = ['mqm' ]
4548
@@ -53,8 +56,8 @@ def get_aix_settings():
5356 include_dirs = ['/usr/mqm/inc' ]
5457
5558 if custom_path :
56- library_dirs . append ( '{}/lib64' .format (custom_path ))
57- include_dirs . append ( '{}/inc' .format (custom_path ))
59+ library_dirs = [ '{}/lib64' .format (custom_path )]
60+ include_dirs = [ '{}/inc' .format (custom_path )]
5861
5962 libraries = ['mqm_r' ]
6063
@@ -68,8 +71,8 @@ def get_generic_unix_settings():
6871 include_dirs = ['/opt/mqm/inc' ]
6972
7073 if custom_path :
71- library_dirs . append ( '{}/lib64' .format (custom_path ))
72- include_dirs . append ( '{}/inc' .format (custom_path ))
74+ library_dirs = [ '{}/lib64' .format (custom_path )]
75+ include_dirs = [ '{}/inc' .format (custom_path )]
7376
7477 # Get an embedded rpath into the library which can reduce need for LD_LIBRARY_PATH
7578 for d in library_dirs :
@@ -141,7 +144,10 @@ def get_locations_by_command_path(command_path):
141144 if os .path .isfile (p ):
142145 found_headers = True
143146if not found_headers :
144- raise FileNotFoundError ("Cannot find MQ C header files. Ensure you have already installed the MQ Client and SDK" )
147+ msg = "Cannot find MQ C header files.\n "
148+ msg += "Ensure you have already installed the MQ Client and SDK.\n "
149+ msg += "Use the MQ_FILE_PATH environment variable to identify a non-default location."
150+ raise FileNotFoundError (msg )
145151
146152LONG_DESCRIPTION = """
147153Python library for IBM MQ
@@ -179,7 +185,7 @@ def get_locations_by_command_path(command_path):
179185 print('Here is the message:', msg)
180186"""
181187
182- # Define how the C module gets built. Set flags to try to build using the Python 3.9
188+ # Define how the C module gets built. Set flags to build using the Python 3.9
183189# Limited API which should make the binary extension forwards compatible.
184190mqi_extension = Extension ('ibmmq.ibmmqc' , c_source ,
185191 define_macros = [('PYVERSION' , '"' + VERSION + '"' ),
0 commit comments