6 Jenkins Test Server script. 8 @note: Start build jobs on the Jenkins Test Server using PyXMake. 11 ---------------------------------------------------------------------------------------------- 19 - hein_fa [DLR-FA,STM Braunschweig] 20 - garb_ma [DLR-FA,STM Braunschweig] 21 ---------------------------------------------------------------------------------------------- 36 from main import releasecreator_Abhi 39 from distutils.command
import clean
as _clean
40 from distutils
import core
49 Little clean extension: Cleans up a non-empty build directory. 52 for path
in [
"build",
"dist",
".coverage"]:
53 if os.path.isdir(path):
55 elif os.path.isfile(path):
61 Base class for encapsulating command line commands. 70 def _create_build_dir():
71 if not os.path.exists(
"build"):
74 def _create_command(self):
77 def _run_command(self, command):
80 subprocess.call(command, shell=
True)
82 def _perform_post_actions(self):
86 class pyx_app(_BaseCommandRunner):
88 Base class for encapsulating command line arguments and build process. 93 description =
"Compile a stand-alone application using PyInstaller." 96 (
'source-path=',
None,
'path to the folder holding source files'),
97 (
'verbose=',
None,
'controls the logging level (0 - Nothing, 2- Everything) Default: 0 - Nothing'),
98 (
'mode=',
None,
'define application build mode (one directory or one file mode)'),
99 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
100 (
'output-file-path=',
None,
'path to the output directory'),
105 Set default values for options. 118 Post-process options. 124 def _run_command(self, command):
126 Execute build command 131 include = []; dependency = []
146 include=include, dependency=dependency,
147 preprocessing=command)
151 Runs the application build process using PyCODAC to create runtime for STMLab. 160 def _create_command(self):
161 from PyXMake
import VTL
165 self.
include=VTL.GetIncludeDirectory(PyCODAC.PyCODACPath, self.
_KEY_OPT),
169 delimn =
" "; continuation =
"&&" 170 command = delimn.join([
171 sys.executable,os.path.join(PyCODAC.PyCODACPath,
"Plugin",
"DELiS",
"__install__.py"),continuation,
172 sys.executable,os.path.join(PyCODAC.PyCODACPath,
"Plugin",
"DELiS",
"__update__.py"),continuation,
173 sys.executable,os.path.join(PyCODAC.PyCODACPath,
"Plugin",
"Smetana",
"__install__.py"),continuation,
174 sys.executable,os.path.join(PyCODAC.PyCODACPath,
"Plugin",
"Smetana",
"__update__.py")
182 Base class for encapsulating command line arguments and build process. 187 description =
"Compile a stand-alone installer using NSIS." 190 (
'source-path=',
None,
'path to the folder holding source files'),
191 (
'verbose=',
None,
'controls the logging level (0 - Nothing, 2- Everything) Default: 0 - Nothing'),
192 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
193 (
'output-file-path=',
None,
'path to the output directory'),
194 (
'install-path=',
None,
'path to the default installation directory'),
199 Set default values for options. 210 Post-process options. 216 def _run_command(self, command):
218 Execute build command 232 user=
'ASRI_adm', key=
'lm9ITHUR', upload =
True)
236 Create an installer for STMLab using PyCODAC. 239 _BUNDLE_NAME =
'STMLab' 242 def _create_command(self):
247 self.
install_path = os.getenv(
"plugin_central_dir",os.path.join(Utility.AsDrive(
"c"),
"simulia",
"cae",
"plugins",
"2019"))
250 __pyc_plugin = os.path.join(self.
source_path,
"PyCODAC")
251 __smet_plugin = os.path.join(self.
source_path,
"Smetana")
253 __pyc_plugin_repo = __url_delimn.join([
"https:",
"",
"svn.dlr.de",
"STM-Routines",
"Analysis_Tools",
"MCODAC",
"trunk",
"src",
"mcd_pycodac",
"PyCODAC",
"Plugin",
"JupyterLab",
"src"])
254 __smet_plugin_repo = __url_delimn.join([
"https:",
"",
"svn.dlr.de",
"STM-Routines",
"Analysis_Tools",
"MCODAC",
"trunk",
"src",
"mcd_pycodac",
"PyCODAC",
"Plugin",
"Smetana",
"src"])
256 svn.remote.RemoteClient(__pyc_plugin_repo).export(__pyc_plugin, force=
True)
257 svn.remote.RemoteClient(__smet_plugin_repo).export(__smet_plugin, force=
True)
259 shutil.rmtree(os.path.join(__pyc_plugin,
".config"), ignore_errors=
True)
260 os.remove(os.path.join(__pyc_plugin,
"user",
"Paths.log"))
269 Base class for encapsulating command line arguments and build process. 274 description =
"Runs the html documentation build process of source code using Sphinx." 277 (
'source-path=',
None,
'path to the folder holding source files'),
278 (
'verbose=',
None,
'controls the logging level (0 - Nothing, 2- Everything) Default: 0 - Nothing'),
279 (
'include-path=',
None,
'path to additional files required for processing.'),
280 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
281 (
'output-file-path=',
None,
'path to the output directory'),
282 (
'logo=',
None,
'Custom logo for the upper left corner. Defaults to None, leaving the space empty'),
287 Set default values for options. 299 Post-process options. 305 def _run_command(self, command):
307 Execute build command 323 Runs the html documentation build process for Structural Mechanics Lab using a scheme from ReadtheDocs. 326 _BUILD_NAME =
'Structural Mechanics Lab' 327 _INPUT_FILE =
"stm_lab" 329 def _create_command(self):
332 __arch = Utility.GetArchitecture()
333 __platform = Utility.GetPlatform()
335 from PyCODAC.Tools.Utility
import GetPyCODACPath
337 __pyc_core_path = GetPyCODACPath()
339 self.
include_path=[os.path.join(__pyc_core_path,
"Plugin",
"Smetana"),
340 os.path.join(__pyc_core_path,
"Plugin",
"Smetana",
"src",
"Smetana"),
341 os.path.join(__pyc_core_path,
"Core",
"bin",__platform,__arch)]
342 self.
logo = os.path.join(__pyc_core_path,
"VTL",
"doc",
"mcd_stmlab",
"pics",
"stm_lab_logo_bubbles.png")
350 Base class for encapsulating command line arguments and build process. 355 description =
"Runs the html documentation build process of source code using Doxygen." 358 (
'source-path=',
None,
'path to the folder holding source files'),
359 (
'verbose=',
None,
'controls the logging level (0 - Nothing, 2- Everything) Default: 0 - Nothing'),
360 (
'stype=',
None,
'define type of source files (Java, Python or left blank) Defaults to: Fortran'),
361 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
362 (
'output-file-path=',
None,
'path to the output directory'),
367 Set default values for options. 373 self.
stype =
"Fortran" 378 Post-process options. 384 def _run_command(self, command):
386 Execute build command 396 title=[self.brief, self.header],
405 Runs the html documentation build process for PyXMake. 408 _BUILD_NAME =
'pyx_core' 410 def _create_command(self):
413 self.
_INPUT_FILES = [x[0]
for x
in Utility.PathWalk(self.
source_path,
True, startswith=(
".",
"__"), contains=(
"doc",
"bin"), endswith=(
"make",
"scratch"))]
415 self.
brief =
"PyXMake" 416 self.
header =
"PyXMake Developer Guide" 422 Runs the html documentation build process for PyCODAC. 425 _BUILD_NAME =
'pyc_core' 427 def _create_command(self):
431 contains=(
"DELiS",
"Smetana",
"PyXMake",
"external",
"doc",
"cmd",
"solver",
"src",
"bin",
"config"),
434 self.
brief =
"PyCODAC" 435 self.
header =
"PyCODAC Developer Guide" 441 Runs the html documentation build process for BoxBeam. 446 _BUILD_NAME =
'box_main' 450 def _create_command(self):
451 self.
brief =
"BoxBeam" 452 self.
header =
"BoxBeam Developer Guide" 458 Runs the html documentation build process for MCODAC. 463 _BUILD_NAME =
'mcd_core' 467 def _create_command(self):
468 self.
brief =
"MCODAC" 469 self.
header =
"MCODAC Developer Guide" 475 Runs the html documentation build process for BoxBeam. 477 _BUILD_NAME =
'mcd_subbuck' 479 def _create_command(self):
480 self.
brief =
"SubBuck" 481 self.
header =
"SubLaminate Buckling Developer Guide" 487 Runs the html documentation build process for BoxBeam. 489 _BUILD_NAME =
'mcd_mapper' 491 def _create_command(self):
492 self.
brief =
"Mapper" 493 self.
header =
"Damage Mapping Developer Guide" 500 Base class for encapsulating command line arguments and build process. 505 description =
"Runs the build process of Fortran source code for Python using f2py." 508 (
'msvsc=',
None,
'identifier, which compiler version from Microsoft Visual Studio to be used'),
509 (
'source-path=',
None,
'path to the folder holding the fortran files'),
510 (
'verbose=',
None,
'controls the logging level (0 - Nothing) Default: 2 - Everything'),
511 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
512 (
'output-file-path=',
None,
'path to the output directory'),
513 (
'base-path=',
None,
'path to base folder - optional'),
518 Set default values for options. 521 self.
_MAKE_OPT = {
"Python":0,
"Java":1,
"Fortran":2}
533 if sys.getwindowsversion() >= (10, 0, 0):
535 self.
msvsc =
"vs2015" 538 self.
msvsc =
"vs2010" 542 Post-process options. 546 'Source path for Fortran files '+self.
source_path+
' does not exist.')
549 'Path to base folder '+self.
base_path+
' does not exist.')
551 def _run_command(self, command):
553 Execute build command 559 includes = []; libs = []; libpaths = []
571 libs=libs,include=includes,dependency=libpaths,
579 Runs the build process for MCODAC. 584 _PACKAGE_NAME =
'mcd_core' 588 def _create_command(self):
589 from PyXMake
import VTL
592 self.
includes = [os.path.join(self.
base_path,
"include",Utility.GetPlatform(),Utility.GetArchitecture(), x)
593 for x
in VTL.GetIncludeDirectory(self.
base_path, 0, 4, Utility.GetArchitecture())],
594 self.
libs = VTL.GetLinkDependency(self.
_KEY_OPT, self.
_MAKE_OPT[
"Python"], Utility.GetArchitecture())
595 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(), Utility.GetArchitecture())
597 return VTL.GetBuildCommand(self.
_MAKE_OPT[
"Python"])
601 Runs the build process for BoxBeam. 606 _PACKAGE_NAME =
'bbeam' 610 def _create_command(self):
616 Runs the build process for Beos. 618 _PACKAGE_NAME =
'beos' 624 def _create_command(self):
632 Base class for encapsulating command line arguments and build process. 637 description =
"Runs the build process of Fortran source code using the Intel Fortran Compiler through Python." 640 (
'source-path=',
None,
'path to the folder holding the fortran files'),
641 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
642 (
'output-file-path=',
None,
'path to the output directory'),
643 (
'base-path=',
None,
'path to base folder - optional'),
644 (
'verbose=',
None,
'controls the logging level (0 - Nothing) Default: 2 - Everything'),
645 (
'btype=',
None,
'controls the building type. Defaults to static library. Use shared to indicate a dynamic library shall be created'),
650 Set default values for options. 653 self.
_MAKE_OPT = {
"Python":0,
"Java":1,
"Fortran":2}
659 self.
btype =
'static' 667 Post-process options. 671 'Source path for Fortran files '+self.
source_path+
' does not exist.')
674 'Path to base folder '+self.
base_path+
' does not exist.')
676 def _run_command(self, command):
678 Execute build command 684 includes = []; libs = []; libpaths = []
711 Runs the build process for MCODAC. 715 _PACKAGE_NAME =
'mcd_java' 719 def _create_command(self):
720 from PyXMake
import VTL
723 self.
includes = [os.path.join(self.
base_path,
"include",Utility.GetPlatform(),Utility.GetArchitecture(), x)
724 for x
in VTL.GetIncludeDirectory(self.
base_path, 0, 4, Utility.GetArchitecture())],
726 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(), Utility.GetArchitecture())
728 return VTL.GetBuildCommand(self.
_MAKE_OPT[
"Java"])
732 Runs the build process for BoxBeam. 737 _PACKAGE_NAME =
'bbeam_java' 741 def _create_command(self):
742 from PyXMake
import VTL
747 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(), Utility.GetArchitecture())
749 return VTL.GetBuildCommand(self.
_MAKE_OPT[
"Java"])
753 Runs the build process for MCODAC on Windows. 758 _PACKAGE_NAME =
'mcd_core' 762 def _create_command(self):
763 from PyXMake
import VTL
766 self.
includes = [os.path.join(self.
base_path,
"include",Utility.GetPlatform(),Utility.GetArchitecture(), x)
767 for x
in VTL.GetIncludeDirectory(self.
base_path, 0, 4, Utility.GetArchitecture())],
768 self.
modules = os.path.join(self.
base_path,
"include",Utility.GetPlatform(), Utility.GetArchitecture())
769 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(), Utility.GetArchitecture())
770 self.
libs = VTL.GetLinkDependency(self.
_KEY_OPT, self.
_MAKE_OPT[
"Fortran"], Utility.GetArchitecture())
772 return VTL.GetBuildCommand(self.
_MAKE_OPT[
"Fortran"])
776 Runs the build process for BoxBeam on Windows. 781 _PACKAGE_NAME =
'bbeam' 785 def _create_command(self):
786 from PyXMake
import VTL
790 self.
libs = VTL.GetLinkDependency(self.
_KEY_OPT, self.
_MAKE_OPT[
"Fortran"], Utility.GetArchitecture())
791 self.
modules = os.path.join(self.
base_path,
"include",Utility.GetPlatform(), Utility.GetArchitecture())
792 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(), Utility.GetArchitecture())
794 return VTL.GetBuildCommand(self.
_MAKE_OPT[
"Fortran"])
798 Base class for encapsulating command line arguments and build process. 803 description =
"Runs an user-defined build process utilizing the PyXMake build environment." 806 (
'msvsc=',
None,
'identifier, which compiler version from Microsoft Visual Studio to be used'),
807 (
'source-path=',
None,
'path to the folder holding source files'),
808 (
'source-file=',
None,
'source file or list of source files. Defaults to "mcd_astandard"'),
809 (
'verbose=',
None,
'controls the logging level (0 - Nothing) Default: 2 - Everything'),
810 (
'scratch-path=',
None,
'path to scratch folder where all temporary data is located during the build event'),
811 (
'base-path=',
None,
'path to base folder - optional'),
812 (
'output-file-path=',
None,
'path to the output directory'),
817 Set default values for options. 831 if sys.getwindowsversion() >= (10, 0, 0):
833 self.
msvsc =
"vs2015" 836 self.
msvsc =
"vs2010" 840 Post-process options. 844 'Source path to build files '+self.
source_path+
' does not exist.')
847 'Path to base folder '+self.
base_path+
' does not exist.')
849 def _run_command(self, command):
851 Execute build command 859 CBuild.Preprocessing(
'fpp /P /e', inend=
'.f', outend=
'.for')
860 CBuild.Build(command)
862 CBuild.AddIncludePath(self.
includes)
864 CBuild.AddDependencyPath(self.
libpaths)
866 CBuild.UseLibraries(self.
libs)
871 Runs the build process of MCODAC for ABAQUS. 874 _PACKAGE_NAME =
'mcd_abaqus' 877 def _create_command(self):
878 from PyXMake
import VTL
882 if (sys.version_info < (3, 0)):
883 raise NotImplementedError
885 elif (sys.version_info > (3, 0)):
886 self.
copyfiles = [
"standardU.dll",
"explicitU-D.dll"]
887 self.
libs =
"mcd_corex64" 888 self.
includes = [os.path.join(self.
base_path,
"include",Utility.GetPlatform(),Utility.GetArchitecture(), x)
889 for x
in VTL.GetIncludeDirectory(self.
base_path, 0, 4, Utility.GetArchitecture())]
890 self.
includes.append(os.path.join(self.
base_path,
"include", Utility.GetPlatform(), Utility.GetArchitecture()))
891 self.
libpaths = os.path.join(self.
base_path,
"lib",Utility.GetPlatform(),Utility.GetArchitecture())
893 return VTL.GetBuildCommand(self.
_MAKE_OPT)
898 Runs the pylint command. 900 _PACKAGE_NAME =
"src" 902 description =
"Runs the pylint command." 904 (
"command=",
None,
"Path and name of the command line tool."),
905 (
"out=",
None,
"Specifies the output type (html, parseable). Default: html")]
907 def initialize_options(self):
912 def finalize_options(self):
913 self.
verbose = self.distribution.verbose
914 if self.
out ==
"parseable":
917 def _create_command(self):
919 "{0} --rcfile=dev/pylintrc --output-format=parseable src > {3}".
922 def _perform_post_actions(self):
923 if self.
out ==
"parseable":
926 for line
in file_object.readlines():
927 line = line.replace(
"\\",
"/")
928 new_content.append(line)
930 file_object.writelines(new_content)
935 Base class for all test classes 937 description =
"Runs all unit tests using py.test." 939 (
"command=",
None,
"Path and name of the command line tool."),
940 (
"out=",
None,
"Specifies the output format of the test results." \
941 +
"Formats: xml, standard out. Default: standard out."),
942 (
"covout=",
None,
"Specifies the output format of the coverage report." \
943 +
"Formats: xml, html.")]
945 def initialize_options(self):
950 def finalize_options(self):
951 self.
verbose = self.distribution.verbose
957 def _create_command(self):
959 if self.
out ==
"xml":
960 options =
"--junitxml=build/xunit.xml test" 961 if not self.
covout is None:
963 "--cov=src --cov-report={0} --cov-config=dev/coveragerc {1}".format(self.
covout, options))
964 return "py.test --cov=src --cov-report=xml --cov-config=dev/coveragerc --junitxml=build/xunit.xml test -m \"not long and not indevelopment\"" 971 def _create_command(self):
973 if self.
out ==
"xml":
974 options =
"--junitxml=build/xunit.xml test" 975 if not self.
covout is None:
977 "--cov=src --cov-report={0} --cov-config=dev/coveragerc {1}".format(self.
covout, options))
978 return "py.test test --junitxml=build/xunit.xml -s -m \"indevelopment\"" 985 def _create_command(self):
987 if self.
out ==
"xml":
988 options =
"--junitxml=build/xunit.xml test" 989 if not self.
covout is None:
991 "--cov=src --cov-report={0} --cov-config=dev/coveragerc {1}".format(self.
covout, options))
992 return "py.test --cov=src --cov-report=xml --cov-config=dev/coveragerc --junitxml=build/xunit.xml test -s" 995 def _perform_setup():
1000 def _set_pythonpath():
1002 python_path = os.pathsep.join(python_path) + os.pathsep + os.environ.get(
"PYTHONPATH",
"")
1003 os.environ[
"PYTHONPATH"] = python_path
1010 if os.path.exists(
'test/__pycache__'):
1011 shutil.rmtree(
'test/__pycache__')
1016 cmdclass={
"clean": Clean,
1017 "doxy_pyxmake": doxy_pyxmake,
1018 "doxy_boxbeam": doxy_boxbeam,
1019 "doxy_mcdcore": doxy_mcdcore,
1020 "doxy_mcdpycodac": doxy_mcdpycodac,
1021 "doxy_mcdmapper": doxy_mcdmapper,
1022 "doxy_mcdsubbuck": doxy_mcdsubbuck,
1023 "sphinx_stmlab": sphinx_stmlab,
1024 "f2py_beos": f2py_beos,
1025 "f2py_boxbeam": f2py_boxbeam,
1026 "f2py_mcodac": f2py_mcodac,
1027 "java_boxbeam": java_boxbeam,
1028 "java_mcodac": java_mcodac,
1029 "win_boxbeam": win_boxbeam,
1030 "win_mcodac": win_mcodac,
1031 "abq_mcodac": abq_mcodac,
1032 "app_pycodac": app_pycodac,
1033 "bundle_pycodac": bundle_pycodac,
1034 "shorttest": Test,
"longtest": LongTest,
"indevelopmenttest": InDevelopmentTest,
1037 author=
"Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR)",
1038 author_email=
"marc.garbade@dlr.de",
1039 maintainer=
"Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR)",
1040 maintainer_email=
"marc.garbade@dlr.de",
1041 license=
"Copyright DLR",
1042 platforms=[
"Linux",
"Unix",
"Windows"],
1043 packages=setuptools.find_packages(
"src"),
1044 include_package_data=
True,
1045 package_dir={
"" :
"src"},
1048 "version": (
"test.py", version),
1049 "release": (
"test.py", version)}},
1053 if __name__ ==
"__main__":
def finalize_options(self)
def GetBuildCommand(make_opt=0, _format="fixed", _arch=Utility.GetArchitecture())
def finalize_options(self)
def finalize_options(self)
def finalize_options(self)
def finalize_options(self)
def GetSourceCode(key_opt=0)
Module containing virtual testing & benchmark scripts.
def _perform_post_actions(self)
def initialize_options(self)
def _run_command(self, command)
def finalize_options(self)
def initialize_options(self)
def initialize_options(self)
def _create_command(self)
def initialize_options(self)
Create a make object to define the building environment.
def initialize_options(self)
def finalize_options(self)
def initialize_options(self)
def initialize_options(self)