11# -*- coding: utf-8 -*-
22
3- from spack .package import *
43import os
4+
55from spack_repo .builtin .build_systems .cmake import CMakePackage
66
7+ from spack .package import *
8+
79
810class Magix3d (CMakePackage ):
911 """Mailleur 3D"""
@@ -18,9 +20,9 @@ class Magix3d(CMakePackage):
1820 variant ("sepa3d" , default = False , description = "Outil de separatrices 3D" )
1921 variant ("smooth3d" , default = False , description = "Bibliotheque de lissage volumique Smooth3D" )
2022 variant ("triton2" , default = True , description = "Mailleur tetraedrique Tetgen" )
21- variant ("pythonaddon" ,
22- default = False ,
23- description = "Additional python modules to enrich PYTHONPATH" )
23+ variant (
24+ "pythonaddon" , default = False , description = "Additional python modules to enrich PYTHONPATH"
25+ )
2426 variant ("doc" , default = False , description = "Installation de la documentation utilisateur" )
2527
2628 version ("2.7.0" , sha256 = "362ac988f8d00e504d7a32f0dbc8e347a9625c344cc06aa24074ff4173442c8b" )
@@ -100,7 +102,7 @@ class Magix3d(CMakePackage):
100102
101103 # setup PYTHON_PATH for documentation
102104 def setup_build_environment (self , env ):
103- if ( "+doc" in self .spec .variants ) :
105+ if "+doc" in self .spec .variants :
104106 python_version = str (self .spec ["python" ].version ).split ("." )
105107 python_dir = "python" + python_version [0 ] + "." + python_version [1 ]
106108
@@ -109,8 +111,9 @@ def setup_build_environment(self, env):
109111 env .prepend_path ("PYTHONPATH" , sphinx_pythonpath )
110112
111113 def cmake_args (self ):
112- return self .fill_cmake_args (False , "undefined" , "undefined" ,
113- "undefined" , "unavailable" , "undefined" , "undefined" )
114+ return self .fill_cmake_args (
115+ False , "undefined" , "undefined" , "undefined" , "unavailable" , "undefined" , "undefined"
116+ )
114117
115118 def fill_cmake_args (self , batch , t_ext , erd_ext , team , dkoc_lic , url_wiki , url_doc_qualif ):
116119 args = []
@@ -120,7 +123,7 @@ def fill_cmake_args(self, batch, t_ext, erd_ext, team, dkoc_lic, url_wiki, url_d
120123 # On installe => mode production pour les scripts fixant l"environnement python d"execution
121124 args .append ("-DPRODUCTION:BOOL=ON" )
122125 if self .spec .satisfies ("%intel" ):
123- args .append (" -DCMAKE_CXX_FLAGS=\ " -std=c++11\" " )
126+ args .append (' -DCMAKE_CXX_FLAGS="-std=c++11"' )
124127
125128 args .append (self .define_from_variant ("DKOC" , "dkoc" ))
126129 args .append (self .define_from_variant ("MDLPARSER" , "mdlparser" ))
@@ -140,23 +143,38 @@ def fill_cmake_args(self, batch, t_ext, erd_ext, team, dkoc_lic, url_wiki, url_d
140143 args .append (self .define ("BUILD_MAGIX3D" , True ))
141144 args .append (self .define ("BUILD_MAGIX3DBATCH" , batch ))
142145
143- if ( "+doc" in self .spec .variants ) :
146+ if "+doc" in self .spec .variants :
144147 args .append ("-DSPHINX_WARNINGS_AS_ERRORS=OFF" )
145148
146149 # only py-numpy py-matplotlib py-scipy are necessary
147150 # the rest are here because we are not in an environment
148151 if "+pythonaddon" in self .spec :
149152 python_version = self .spec ["python" ].version .up_to (2 )
150- py_depends = ["py-numpy" , "py-matplotlib" , "py-scipy" ,
151- "py-cycler" , "py-kiwisolver" ,
152- "py-pillow" , "py-pyparsing" , "py-python-dateutil" ,
153- "py-pytz" , "py-setuptools" , "py-setuptools-scm" ,
154- "py-six" , "py-packaging" ]
153+ py_depends = [
154+ "py-numpy" ,
155+ "py-matplotlib" ,
156+ "py-scipy" ,
157+ "py-cycler" ,
158+ "py-kiwisolver" ,
159+ "py-pillow" ,
160+ "py-pyparsing" ,
161+ "py-python-dateutil" ,
162+ "py-pytz" ,
163+ "py-setuptools" ,
164+ "py-setuptools-scm" ,
165+ "py-six" ,
166+ "py-packaging" ,
167+ ]
155168 python_path = []
156169 for py_dep in py_depends :
157- python_path .append (os .path .join (self .spec [py_dep ].prefix , "lib" ,
158- "python" + str (python_version ),
159- "site-packages" ))
170+ python_path .append (
171+ os .path .join (
172+ self .spec [py_dep ].prefix ,
173+ "lib" ,
174+ "python" + str (python_version ),
175+ "site-packages" ,
176+ )
177+ )
160178 args .append ("-DADDPYTHONPACKAGES=" + ":" .join (python_path ) + ":" )
161179
162180 return args
0 commit comments