PBuildXPLevelAPI.gms : Test building and installing the GAMS Python API from source distribution

Description

Contributor: Clemens Westphal, March 2020


Small Model of Type : Python


Category : GAMS API library


Main file : PBuildXPLevelAPI.gms

$title 'Test building and installing the GAMS Python API from source distribution' (PBUILDXPLEVELAPI,SEQ=57)

$onText
Contributor: Clemens Westphal, March 2020
$offText


$set sdistPath %gams.sysdir%api%system.dirsep%python%system.dirsep%sdist
$set examplePath %gams.sysdir%api%system.dirsep%python%system.dirsep%examples%system.dirsep%

$ifThen setenv PYTHON39
$  call.checkErrorLevel cd . && "%sysenv.PYTHON39%" -m pip install gamsapi --find-links "%sdistPath%" --target=api_39 --no-index --no-cache-dir
* problems installing psycopg2-binary on DAC for Python 3.9 #6375
$  ifThen not %system.platform% == DAX
$    call.checkErrorLevel cd . && "%sysenv.PYTHON39%" -m pip install gamsapi[all] --target=api_39 --no-cache-dir --dry-run
$  endif
$  setEnv PYTHONPATH api_39
$  call.checkErrorLevel cd . && "%sysenv.PYTHON39%" "%examplePath%core%system.dirsep%core_example1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON39%" "%examplePath%control%system.dirsep%transport1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON39%" "%examplePath%transfer%system.dirsep%transport_gt.py" "%gams.sysdir%."
$endIf

$ifThen setenv PYTHON310
$  call.checkErrorLevel cd . && "%sysenv.PYTHON310%" -m pip install gamsapi --find-links "%sdistPath%" --target=api_310 --no-index --no-cache-dir
$  call.checkErrorLevel cd . && "%sysenv.PYTHON310%" -m pip install gamsapi[all] --target=api_310 --no-cache-dir --dry-run
$  setEnv PYTHONPATH api_310
$  call.checkErrorLevel cd . && "%sysenv.PYTHON310%" "%examplePath%core%system.dirsep%core_example1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON310%" "%examplePath%control%system.dirsep%transport1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON310%" "%examplePath%transfer%system.dirsep%transport_gt.py" "%gams.sysdir%."
$endIf

$ifThen setenv PYTHON311
$  call.checkErrorLevel cd . && "%sysenv.PYTHON311%" -m pip install gamsapi --find-links "%sdistPath%" --target=api_311 --no-index --no-cache-dir
$  call.checkErrorLevel cd . && "%sysenv.PYTHON311%" -m pip install gamsapi[all] --target=api_311 --no-cache-dir --dry-run
$  setEnv PYTHONPATH api_311
$  call.checkErrorLevel cd . && "%sysenv.PYTHON311%" "%examplePath%core%system.dirsep%core_example1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON311%" "%examplePath%control%system.dirsep%transport1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON311%" "%examplePath%transfer%system.dirsep%transport_gt.py" "%gams.sysdir%."
$endIf

$ifThen setenv PYTHON312
$  call.checkErrorLevel cd . && "%sysenv.PYTHON312%" -m pip install gamsapi --find-links "%sdistPath%" --target=api_312 --no-index --no-cache-dir
$  call.checkErrorLevel cd . && "%sysenv.PYTHON312%" -m pip install gamsapi[all] --target=api_312 --no-cache-dir --dry-run
$  setEnv PYTHONPATH api_312
$  call.checkErrorLevel cd . && "%sysenv.PYTHON312%" "%examplePath%core%system.dirsep%core_example1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON312%" "%examplePath%control%system.dirsep%transport1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON312%" "%examplePath%transfer%system.dirsep%transport_gt.py" "%gams.sysdir%."
$endIf

$ifThen setenv PYTHON313
$  call.checkErrorLevel cd . && "%sysenv.PYTHON313%" -m pip install gamsapi --find-links "%sdistPath%" --target=api_313 --no-index --no-cache-dir
$  call.checkErrorLevel cd . && "%sysenv.PYTHON313%" -m pip install gamsapi[all] --target=api_313 --no-cache-dir --dry-run
$  setEnv PYTHONPATH api_313
$  call.checkErrorLevel cd . && "%sysenv.PYTHON313%" "%examplePath%core%system.dirsep%core_example1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON313%" "%examplePath%control%system.dirsep%transport1.py" "%gams.sysdir%."
$  call.checkErrorLevel cd . && "%sysenv.PYTHON313%" "%examplePath%transfer%system.dirsep%transport_gt.py" "%gams.sysdir%."
$endIf