[f36e01f] | 1 | # -*- coding: utf-8 -*- |
---|
| 2 | #!/usr/bin/env python |
---|
| 3 | |
---|
[d6bc28cf] | 4 | """ |
---|
[c329f4d] | 5 | Setup for SasView |
---|
[f36e01f] | 6 | TODO: Add checks to see that all the dependencies are on the system |
---|
[d6bc28cf] | 7 | """ |
---|
[f36e01f] | 8 | |
---|
[d6bc28cf] | 9 | import os |
---|
[6c7e4cc1] | 10 | import subprocess |
---|
[c8843be] | 11 | import shutil |
---|
[f36e01f] | 12 | import sys |
---|
[2cef9d3] | 13 | from distutils.command.build_ext import build_ext |
---|
[968aa6e] | 14 | from distutils.core import Command |
---|
[f36e01f] | 15 | |
---|
[9a5097c] | 16 | import numpy as np |
---|
[f36e01f] | 17 | from setuptools import Extension, setup |
---|
[d6bc28cf] | 18 | |
---|
[5548954] | 19 | # Manage version number ###################################### |
---|
[3a39c2e] | 20 | import sasview |
---|
[f36e01f] | 21 | |
---|
[3a39c2e] | 22 | VERSION = sasview.__version__ |
---|
[5548954] | 23 | ############################################################## |
---|
| 24 | |
---|
[d6bc28cf] | 25 | package_dir = {} |
---|
| 26 | package_data = {} |
---|
| 27 | packages = [] |
---|
| 28 | ext_modules = [] |
---|
| 29 | |
---|
[8ab3302] | 30 | # Remove all files that should be updated by this setup |
---|
[3a39c2e] | 31 | # We do this here because application updates these files from .sasview |
---|
[8ab3302] | 32 | # except when there is no such file |
---|
| 33 | # Todo : make this list generic |
---|
[f36e01f] | 34 | # plugin_model_list = ['polynominal5.py', 'sph_bessel_jn.py', |
---|
[a62945e] | 35 | # 'sum_Ap1_1_Ap2.py', 'sum_p1_p2.py', |
---|
| 36 | # 'testmodel_2.py', 'testmodel.py', |
---|
| 37 | # 'polynominal5.pyc', 'sph_bessel_jn.pyc', |
---|
| 38 | # 'sum_Ap1_1_Ap2.pyc', 'sum_p1_p2.pyc', |
---|
| 39 | # 'testmodel_2.pyc', 'testmodel.pyc', 'plugins.log'] |
---|
[c8843be] | 40 | |
---|
| 41 | CURRENT_SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
---|
| 42 | SASVIEW_BUILD = os.path.join(CURRENT_SCRIPT_DIR, "build") |
---|
| 43 | |
---|
[f36e01f] | 44 | sas_dir = os.path.join(os.path.expanduser("~"), '.sasview') |
---|
[3a39c2e] | 45 | if os.path.isdir(sas_dir): |
---|
| 46 | f_path = os.path.join(sas_dir, "sasview.log") |
---|
[e615a0d] | 47 | if os.path.isfile(f_path): |
---|
| 48 | os.remove(f_path) |
---|
[50008e3] | 49 | f_path = os.path.join(sas_dir, "categories.json") |
---|
[ea5fa58] | 50 | if os.path.isfile(f_path): |
---|
| 51 | os.remove(f_path) |
---|
[3a39c2e] | 52 | f_path = os.path.join(sas_dir, 'config', "custom_config.py") |
---|
[e615a0d] | 53 | if os.path.isfile(f_path): |
---|
| 54 | os.remove(f_path) |
---|
[5881b17] | 55 | #f_path = os.path.join(sas_dir, 'plugin_models') |
---|
[f36e01f] | 56 | # if os.path.isdir(f_path): |
---|
[a62945e] | 57 | # for f in os.listdir(f_path): |
---|
| 58 | # if f in plugin_model_list: |
---|
| 59 | # file_path = os.path.join(f_path, f) |
---|
| 60 | # os.remove(file_path) |
---|
[c8843be] | 61 | if os.path.exists(SASVIEW_BUILD): |
---|
[f36e01f] | 62 | print("Removing existing build directory", |
---|
| 63 | SASVIEW_BUILD, "for a clean build") |
---|
[c8843be] | 64 | shutil.rmtree(SASVIEW_BUILD) |
---|
[18e7309] | 65 | |
---|
[e615a0d] | 66 | # 'sys.maxsize' and 64bit: Not supported for python2.5 |
---|
| 67 | is_64bits = False |
---|
| 68 | if sys.version_info >= (2, 6): |
---|
| 69 | is_64bits = sys.maxsize > 2**32 |
---|
[18e7309] | 70 | |
---|
[7a04dbb] | 71 | enable_openmp = False |
---|
[e79a467] | 72 | |
---|
[f36e01f] | 73 | if sys.platform == 'darwin': |
---|
[f468791] | 74 | if not is_64bits: |
---|
| 75 | # Disable OpenMP |
---|
| 76 | enable_openmp = False |
---|
| 77 | else: |
---|
| 78 | # Newer versions of Darwin don't support openmp |
---|
| 79 | try: |
---|
| 80 | darwin_ver = int(os.uname()[2].split('.')[0]) |
---|
| 81 | if darwin_ver >= 12: |
---|
| 82 | enable_openmp = False |
---|
| 83 | except: |
---|
[f3bf622] | 84 | print("PROBLEM determining Darwin version") |
---|
[b30ed8f] | 85 | |
---|
| 86 | # Options to enable OpenMP |
---|
[f36e01f] | 87 | copt = {'msvc': ['/openmp'], |
---|
| 88 | 'mingw32': ['-fopenmp'], |
---|
| 89 | 'unix': ['-fopenmp']} |
---|
| 90 | lopt = {'msvc': ['/MANIFEST'], |
---|
| 91 | 'mingw32': ['-fopenmp'], |
---|
| 92 | 'unix': ['-lgomp']} |
---|
[13f00a0] | 93 | |
---|
[ebdb833] | 94 | # Platform-specific link options |
---|
[f36e01f] | 95 | platform_lopt = {'msvc': ['/MANIFEST']} |
---|
[307fa4f] | 96 | platform_copt = {} |
---|
[b9c8fc5] | 97 | |
---|
| 98 | # Set copts to get compile working on OS X >= 10.9 using clang |
---|
[f36e01f] | 99 | if sys.platform == 'darwin': |
---|
[b9c8fc5] | 100 | try: |
---|
| 101 | darwin_ver = int(os.uname()[2].split('.')[0]) |
---|
[4adf48e] | 102 | if darwin_ver >= 13 and darwin_ver < 14: |
---|
[f36e01f] | 103 | platform_copt = { |
---|
| 104 | 'unix': ['-Wno-error=unused-command-line-argument-hard-error-in-future']} |
---|
[b9c8fc5] | 105 | except: |
---|
[f3bf622] | 106 | print("PROBLEM determining Darwin version") |
---|
[b9c8fc5] | 107 | |
---|
[f36e01f] | 108 | |
---|
[5972029] | 109 | class DisableOpenMPCommand(Command): |
---|
| 110 | description = "The version of MinGW that comes with Anaconda does not come with OpenMP :( "\ |
---|
| 111 | "This commands means we can turn off compiling with OpenMP for this or any "\ |
---|
| 112 | "other reason." |
---|
| 113 | user_options = [] |
---|
| 114 | |
---|
| 115 | def initialize_options(self): |
---|
| 116 | self.cwd = None |
---|
| 117 | |
---|
| 118 | def finalize_options(self): |
---|
| 119 | self.cwd = os.getcwd() |
---|
| 120 | global enable_openmp |
---|
| 121 | enable_openmp = False |
---|
[1829835] | 122 | |
---|
[5972029] | 123 | def run(self): |
---|
| 124 | pass |
---|
[ebdb833] | 125 | |
---|
[f36e01f] | 126 | |
---|
| 127 | class build_ext_subclass(build_ext): |
---|
[13f00a0] | 128 | def build_extensions(self): |
---|
| 129 | # Get 64-bitness |
---|
| 130 | c = self.compiler.compiler_type |
---|
[f3bf622] | 131 | print("Compiling with %s (64bit=%s)" % (c, str(is_64bits))) |
---|
[18e7309] | 132 | |
---|
[ebdb833] | 133 | # OpenMP build options |
---|
[b30ed8f] | 134 | if enable_openmp: |
---|
[f3bf622] | 135 | if c in copt: |
---|
[5980b1a] | 136 | for e in self.extensions: |
---|
[f36e01f] | 137 | e.extra_compile_args = copt[c] |
---|
[f3bf622] | 138 | if c in lopt: |
---|
[13f00a0] | 139 | for e in self.extensions: |
---|
[f36e01f] | 140 | e.extra_link_args = lopt[c] |
---|
[18e7309] | 141 | |
---|
[ebdb833] | 142 | # Platform-specific build options |
---|
[f3bf622] | 143 | if c in platform_lopt: |
---|
[ebdb833] | 144 | for e in self.extensions: |
---|
[f36e01f] | 145 | e.extra_link_args = platform_lopt[c] |
---|
[ebdb833] | 146 | |
---|
[f3bf622] | 147 | if c in platform_copt: |
---|
[1829835] | 148 | for e in self.extensions: |
---|
[f36e01f] | 149 | e.extra_compile_args = platform_copt[c] |
---|
[1829835] | 150 | |
---|
[13f00a0] | 151 | build_ext.build_extensions(self) |
---|
[d6bc28cf] | 152 | |
---|
[f36e01f] | 153 | |
---|
[968aa6e] | 154 | class BuildSphinxCommand(Command): |
---|
| 155 | description = "Build Sphinx documentation." |
---|
| 156 | user_options = [] |
---|
| 157 | |
---|
| 158 | def initialize_options(self): |
---|
| 159 | self.cwd = None |
---|
| 160 | |
---|
| 161 | def finalize_options(self): |
---|
| 162 | self.cwd = os.getcwd() |
---|
| 163 | |
---|
[d8c4019] | 164 | def run(self): |
---|
[115eb7e] | 165 | ''' First builds the sasmodels documentation if the directory |
---|
| 166 | is present. Then builds the sasview docs. |
---|
| 167 | ''' |
---|
| 168 | ### AJJ - Add code for building sasmodels docs here: |
---|
| 169 | # check for doc path |
---|
[14bb7a4] | 170 | SASMODELS_DOCPATH = os.path.abspath(os.path.join(os.getcwd(), '..', 'sasmodels', 'doc')) |
---|
| 171 | print("========= check for sasmodels at", SASMODELS_DOCPATH, "============") |
---|
[6c7e4cc1] | 172 | if os.path.exists(SASMODELS_DOCPATH): |
---|
| 173 | if os.path.isdir(SASMODELS_DOCPATH): |
---|
[115eb7e] | 174 | # if available, build sasmodels docs |
---|
[21bba86] | 175 | print("============= Building sasmodels model documentation ===============") |
---|
[14bb7a4] | 176 | smdocbuild = subprocess.call(["make", "-C", SASMODELS_DOCPATH, "html"]) |
---|
[6c7e4cc1] | 177 | else: |
---|
| 178 | # if not available warning message |
---|
[21bba86] | 179 | print("== !!WARNING!! sasmodels directory not found. Cannot build model docs. ==") |
---|
[115eb7e] | 180 | |
---|
| 181 | #Now build sasview (+sasmodels) docs |
---|
[d8c4019] | 182 | sys.path.append("docs/sphinx-docs") |
---|
| 183 | import build_sphinx |
---|
[c2ee2b1] | 184 | build_sphinx.rebuild() |
---|
[968aa6e] | 185 | |
---|
[f36e01f] | 186 | |
---|
[3a39c2e] | 187 | # sas module |
---|
| 188 | package_dir["sas"] = os.path.join("src", "sas") |
---|
| 189 | packages.append("sas") |
---|
[29e96f3] | 190 | |
---|
[e0bbb7c] | 191 | # sas module |
---|
| 192 | package_dir["sas.sasgui"] = os.path.join("src", "sas", "sasgui") |
---|
| 193 | packages.append("sas.sasgui") |
---|
| 194 | |
---|
| 195 | # sas module |
---|
| 196 | package_dir["sas.sascalc"] = os.path.join("src", "sas", "sascalc") |
---|
| 197 | packages.append("sas.sascalc") |
---|
| 198 | |
---|
| 199 | # sas.sascalc.invariant |
---|
[f36e01f] | 200 | package_dir["sas.sascalc.invariant"] = os.path.join( |
---|
| 201 | "src", "sas", "sascalc", "invariant") |
---|
[e0bbb7c] | 202 | packages.extend(["sas.sascalc.invariant"]) |
---|
[d6bc28cf] | 203 | |
---|
[d85c194] | 204 | # sas.sasgui.guiframe |
---|
| 205 | guiframe_path = os.path.join("src", "sas", "sasgui", "guiframe") |
---|
| 206 | package_dir["sas.sasgui.guiframe"] = guiframe_path |
---|
[f36e01f] | 207 | package_dir["sas.sasgui.guiframe.local_perspectives"] = os.path.join( |
---|
| 208 | os.path.join(guiframe_path, "local_perspectives")) |
---|
[d85c194] | 209 | package_data["sas.sasgui.guiframe"] = ['images/*', 'media/*'] |
---|
[f36e01f] | 210 | packages.extend( |
---|
| 211 | ["sas.sasgui.guiframe", "sas.sasgui.guiframe.local_perspectives"]) |
---|
[d6bc28cf] | 212 | # build local plugin |
---|
[5980b1a] | 213 | for d in os.listdir(os.path.join(guiframe_path, "local_perspectives")): |
---|
[f36e01f] | 214 | if d not in ['.svn', '__init__.py', '__init__.pyc']: |
---|
[d85c194] | 215 | package_name = "sas.sasgui.guiframe.local_perspectives." + d |
---|
[3d24489] | 216 | packages.append(package_name) |
---|
[f36e01f] | 217 | package_dir[package_name] = os.path.join( |
---|
| 218 | guiframe_path, "local_perspectives", d) |
---|
[d6bc28cf] | 219 | |
---|
[e0bbb7c] | 220 | # sas.sascalc.dataloader |
---|
[f36e01f] | 221 | package_dir["sas.sascalc.dataloader"] = os.path.join( |
---|
| 222 | "src", "sas", "sascalc", "dataloader") |
---|
| 223 | package_data["sas.sascalc.dataloader.readers"] = [ |
---|
| 224 | 'defaults.json', 'schema/*.xsd'] |
---|
| 225 | packages.extend(["sas.sascalc.dataloader", "sas.sascalc.dataloader.readers", |
---|
| 226 | "sas.sascalc.dataloader.readers.schema"]) |
---|
[d6bc28cf] | 227 | |
---|
| 228 | |
---|
[e0bbb7c] | 229 | # sas.sascalc.calculator |
---|
[9e531f2] | 230 | gen_dir = os.path.join("src", "sas", "sascalc", "calculator", "c_extensions") |
---|
| 231 | package_dir["sas.sascalc.calculator.core"] = gen_dir |
---|
[f36e01f] | 232 | package_dir["sas.sascalc.calculator"] = os.path.join( |
---|
| 233 | "src", "sas", "sascalc", "calculator") |
---|
| 234 | packages.extend(["sas.sascalc.calculator", "sas.sascalc.calculator.core"]) |
---|
| 235 | ext_modules.append(Extension("sas.sascalc.calculator.core.sld2i", |
---|
| 236 | sources=[ |
---|
| 237 | os.path.join(gen_dir, "sld2i_module.cpp"), |
---|
| 238 | os.path.join(gen_dir, "sld2i.cpp"), |
---|
| 239 | os.path.join(gen_dir, "libfunc.c"), |
---|
| 240 | os.path.join(gen_dir, "librefl.c"), |
---|
| 241 | ], |
---|
| 242 | include_dirs=[gen_dir], |
---|
| 243 | ) |
---|
| 244 | ) |
---|
[9e531f2] | 245 | |
---|
[b699768] | 246 | # sas.sascalc.pr |
---|
[f36e01f] | 247 | srcdir = os.path.join("src", "sas", "sascalc", "pr", "c_extensions") |
---|
[b699768] | 248 | package_dir["sas.sascalc.pr.core"] = srcdir |
---|
[f36e01f] | 249 | package_dir["sas.sascalc.pr"] = os.path.join("src", "sas", "sascalc", "pr") |
---|
| 250 | packages.extend(["sas.sascalc.pr", "sas.sascalc.pr.core"]) |
---|
| 251 | ext_modules.append(Extension("sas.sascalc.pr.core.pr_inversion", |
---|
| 252 | sources=[os.path.join(srcdir, "Cinvertor.c"), |
---|
| 253 | os.path.join(srcdir, "invertor.c"), |
---|
| 254 | ], |
---|
| 255 | include_dirs=[], |
---|
| 256 | )) |
---|
[18e7309] | 257 | |
---|
| 258 | |
---|
| 259 | # sas.sascalc.file_converter |
---|
| 260 | mydir = os.path.join("src", "sas", "sascalc", "file_converter", "c_ext") |
---|
| 261 | package_dir["sas.sascalc.file_converter.core"] = mydir |
---|
[f36e01f] | 262 | package_dir["sas.sascalc.file_converter"] = os.path.join( |
---|
| 263 | "src", "sas", "sascalc", "file_converter") |
---|
| 264 | packages.extend(["sas.sascalc.file_converter", |
---|
| 265 | "sas.sascalc.file_converter.core"]) |
---|
| 266 | ext_modules.append(Extension("sas.sascalc.file_converter.core.bsl_loader", |
---|
| 267 | sources=[os.path.join(mydir, "bsl_loader.c")], |
---|
| 268 | include_dirs=[np.get_include()], |
---|
| 269 | )) |
---|
| 270 | |
---|
| 271 | # sas.sascalc.corfunc |
---|
| 272 | package_dir["sas.sascalc.corfunc"] = os.path.join( |
---|
| 273 | "src", "sas", "sascalc", "corfunc") |
---|
[b854587] | 274 | |
---|
[1e13b53] | 275 | packages.extend(["sas.sascalc.corfunc"]) |
---|
| 276 | |
---|
[b699768] | 277 | # sas.sascalc.fit |
---|
| 278 | package_dir["sas.sascalc.fit"] = os.path.join("src", "sas", "sascalc", "fit") |
---|
| 279 | packages.append("sas.sascalc.fit") |
---|
[3d24489] | 280 | |
---|
| 281 | # Perspectives |
---|
[f36e01f] | 282 | package_dir["sas.sasgui.perspectives"] = os.path.join( |
---|
| 283 | "src", "sas", "sasgui", "perspectives") |
---|
| 284 | package_dir["sas.sasgui.perspectives.pr"] = os.path.join( |
---|
| 285 | "src", "sas", "sasgui", "perspectives", "pr") |
---|
| 286 | packages.extend(["sas.sasgui.perspectives", "sas.sasgui.perspectives.pr"]) |
---|
[1e13b53] | 287 | package_data["sas.sasgui.perspectives.pr"] = ['media/*'] |
---|
[d85c194] | 288 | |
---|
[f36e01f] | 289 | package_dir["sas.sasgui.perspectives.invariant"] = os.path.join( |
---|
| 290 | "src", "sas", "sasgui", "perspectives", "invariant") |
---|
[d85c194] | 291 | packages.extend(["sas.sasgui.perspectives.invariant"]) |
---|
[f36e01f] | 292 | package_data['sas.sasgui.perspectives.invariant'] = [ |
---|
| 293 | os.path.join("media", '*')] |
---|
| 294 | |
---|
| 295 | package_dir["sas.sasgui.perspectives.fitting"] = os.path.join( |
---|
| 296 | "src", "sas", "sasgui", "perspectives", "fitting") |
---|
| 297 | package_dir["sas.sasgui.perspectives.fitting.plugin_models"] = os.path.join( |
---|
| 298 | "src", "sas", "sasgui", "perspectives", "fitting", "plugin_models") |
---|
| 299 | packages.extend(["sas.sasgui.perspectives.fitting", |
---|
| 300 | "sas.sasgui.perspectives.fitting.plugin_models"]) |
---|
| 301 | package_data['sas.sasgui.perspectives.fitting'] = [ |
---|
| 302 | 'media/*', 'plugin_models/*'] |
---|
| 303 | |
---|
| 304 | packages.extend(["sas.sasgui.perspectives", |
---|
| 305 | "sas.sasgui.perspectives.calculator"]) |
---|
[d85c194] | 306 | package_data['sas.sasgui.perspectives.calculator'] = ['images/*', 'media/*'] |
---|
[18e7309] | 307 | |
---|
[f36e01f] | 308 | package_dir["sas.sasgui.perspectives.corfunc"] = os.path.join( |
---|
| 309 | "src", "sas", "sasgui", "perspectives", "corfunc") |
---|
[1e13b53] | 310 | packages.extend(["sas.sasgui.perspectives.corfunc"]) |
---|
| 311 | package_data['sas.sasgui.perspectives.corfunc'] = ['media/*'] |
---|
| 312 | |
---|
[f36e01f] | 313 | package_dir["sas.sasgui.perspectives.file_converter"] = os.path.join( |
---|
| 314 | "src", "sas", "sasgui", "perspectives", "file_converter") |
---|
[1e13b53] | 315 | packages.extend(["sas.sasgui.perspectives.file_converter"]) |
---|
| 316 | package_data['sas.sasgui.perspectives.file_converter'] = ['media/*'] |
---|
| 317 | |
---|
[d6bc28cf] | 318 | # Data util |
---|
[f36e01f] | 319 | package_dir["sas.sascalc.data_util"] = os.path.join( |
---|
| 320 | "src", "sas", "sascalc", "data_util") |
---|
[b699768] | 321 | packages.append("sas.sascalc.data_util") |
---|
[d6bc28cf] | 322 | |
---|
| 323 | # Plottools |
---|
[f36e01f] | 324 | package_dir["sas.sasgui.plottools"] = os.path.join( |
---|
| 325 | "src", "sas", "sasgui", "plottools") |
---|
[d7bb526] | 326 | packages.append("sas.sasgui.plottools") |
---|
[d6bc28cf] | 327 | |
---|
[9274711] | 328 | # # Last of the sas.models |
---|
| 329 | # package_dir["sas.models"] = os.path.join("src", "sas", "models") |
---|
| 330 | # packages.append("sas.models") |
---|
[2d1b700] | 331 | |
---|
[d6bc28cf] | 332 | EXTENSIONS = [".c", ".cpp"] |
---|
| 333 | |
---|
[f36e01f] | 334 | |
---|
[d6bc28cf] | 335 | def append_file(file_list, dir_path): |
---|
| 336 | """ |
---|
| 337 | Add sources file to sources |
---|
| 338 | """ |
---|
| 339 | for f in os.listdir(dir_path): |
---|
| 340 | if os.path.isfile(os.path.join(dir_path, f)): |
---|
| 341 | _, ext = os.path.splitext(f) |
---|
[4c29e4d] | 342 | if ext.lower() in EXTENSIONS: |
---|
[9e531f2] | 343 | file_list.append(os.path.join(dir_path, f)) |
---|
[d6bc28cf] | 344 | elif os.path.isdir(os.path.join(dir_path, f)) and \ |
---|
| 345 | not f.startswith("."): |
---|
| 346 | sub_dir = os.path.join(dir_path, f) |
---|
| 347 | for new_f in os.listdir(sub_dir): |
---|
| 348 | if os.path.isfile(os.path.join(sub_dir, new_f)): |
---|
| 349 | _, ext = os.path.splitext(new_f) |
---|
[4c29e4d] | 350 | if ext.lower() in EXTENSIONS: |
---|
[9e531f2] | 351 | file_list.append(os.path.join(sub_dir, new_f)) |
---|
[820df88] | 352 | |
---|
[f36e01f] | 353 | |
---|
[820df88] | 354 | # Comment out the following to avoid rebuilding all the models |
---|
[9e531f2] | 355 | file_sources = [] |
---|
| 356 | append_file(file_sources, gen_dir) |
---|
[820df88] | 357 | |
---|
[f36e01f] | 358 | # Wojtek's hacky way to add doc files while bundling egg |
---|
| 359 | # def add_doc_files(directory): |
---|
[5881b17] | 360 | # paths = [] |
---|
| 361 | # for (path, directories, filenames) in os.walk(directory): |
---|
| 362 | # for filename in filenames: |
---|
| 363 | # paths.append(os.path.join(path, filename)) |
---|
| 364 | # return paths |
---|
| 365 | |
---|
| 366 | #doc_files = add_doc_files('doc') |
---|
| 367 | |
---|
[c329f4d] | 368 | # SasView |
---|
[3a39c2e] | 369 | package_dir["sas.sasview"] = "sasview" |
---|
[5881b17] | 370 | package_data['sas.sasview'] = ['images/*', |
---|
[bbb8a56] | 371 | 'media/*', |
---|
[2a8b4756] | 372 | 'logging.ini', |
---|
[d4c88e24] | 373 | 'test/*.txt', |
---|
[bbb8a56] | 374 | 'test/1d_data/*', |
---|
| 375 | 'test/2d_data/*', |
---|
[27109e5] | 376 | 'test/convertible_files/*', |
---|
| 377 | 'test/coordinate_data/*', |
---|
| 378 | 'test/image_data/*', |
---|
| 379 | 'test/media/*', |
---|
| 380 | 'test/other_files/*', |
---|
[bbb8a56] | 381 | 'test/save_states/*', |
---|
[27109e5] | 382 | 'test/sesans_data/*' |
---|
| 383 | ] |
---|
[3a39c2e] | 384 | packages.append("sas.sasview") |
---|
[d6bc28cf] | 385 | |
---|
[9f32c57] | 386 | required = [ |
---|
[243fbc0] | 387 | 'bumps>=0.7.5.9', 'periodictable>=1.3.1', 'pyparsing<2.0.0', |
---|
[9f32c57] | 388 | |
---|
| 389 | # 'lxml>=2.2.2', |
---|
[db74ee8] | 390 | 'lxml', 'h5py', |
---|
[9f32c57] | 391 | |
---|
[f36e01f] | 392 | # The following dependecies won't install automatically, so assume them |
---|
| 393 | # The numbers should be bumped up for matplotlib and wxPython as well. |
---|
[9f32c57] | 394 | # 'numpy>=1.4.1', 'scipy>=0.7.2', 'matplotlib>=0.99.1.1', |
---|
| 395 | # 'wxPython>=2.8.11', 'pil', |
---|
[f36e01f] | 396 | ] |
---|
[213b445] | 397 | |
---|
[f36e01f] | 398 | if os.name == 'nt': |
---|
[7a211030] | 399 | required.extend(['html5lib', 'reportlab']) |
---|
[7f59928e] | 400 | else: |
---|
[775d06f] | 401 | # 'pil' is now called 'pillow' |
---|
[5f6336f] | 402 | required.extend(['pillow']) |
---|
[5881b17] | 403 | |
---|
[18e7309] | 404 | # Set up SasView |
---|
[d6bc28cf] | 405 | setup( |
---|
[c329f4d] | 406 | name="sasview", |
---|
[f36e01f] | 407 | version=VERSION, |
---|
| 408 | description="SasView application", |
---|
| 409 | author="SasView Team", |
---|
| 410 | author_email="developers@sasview.org", |
---|
| 411 | url="http://sasview.org", |
---|
| 412 | license="PSF", |
---|
| 413 | keywords="small-angle x-ray and neutron scattering analysis", |
---|
| 414 | download_url="https://github.com/SasView/sasview.git", |
---|
| 415 | package_dir=package_dir, |
---|
| 416 | packages=packages, |
---|
| 417 | package_data=package_data, |
---|
| 418 | ext_modules=ext_modules, |
---|
| 419 | install_requires=required, |
---|
| 420 | zip_safe=False, |
---|
| 421 | entry_points={ |
---|
| 422 | 'console_scripts': [ |
---|
| 423 | "sasview = sas.sasview.sasview:run", |
---|
| 424 | ] |
---|
| 425 | }, |
---|
| 426 | cmdclass={'build_ext': build_ext_subclass, |
---|
| 427 | 'docs': BuildSphinxCommand, |
---|
| 428 | 'disable_openmp': DisableOpenMPCommand} |
---|
| 429 | ) |
---|