Skip to content
Browse files

scipy_core package is now functional. Usage:

  cvs checkout scipy_core
  setup_scipy_core.py install  # to install scipy_{distutils,test,base}
  setup_scipy_core.py sdist    # to create Scipy_core-<version>.tar.gz
  • Loading branch information...
1 parent e95e42e commit e8fa0139ed576c4e5329a9b7813eb8f4a900f138 @pearu pearu committed Mar 7, 2003
Showing with 64 additions and 28 deletions.
  1. +64 −28 setup_scipy_core.py
View
92 setup_scipy_core.py
@@ -1,41 +1,77 @@
#!/usr/bin/env python
"""
Bundle of SciPy core modules:
- scipy_test, scipy_distutils
+ scipy_test
+ scipy_distutils
+ scipy_base
Usage:
python setup_scipy_core.py install
python setup_scipy_core.py sdist -f -t MANIFEST_scipy_core.in
"""
-from scipy_distutils import scipy_distutils_version as v1
-from scipy_test import scipy_test_version as v2
+import os
+import sys
-major = max(v1.major,v2.major)
-minor = max(v1.minor,v2.minor)
-micro = max(v1.micro,v2.micro)
-release_level = min(v1.release_level,v2.release_level)
-cvs_minor = v1.cvs_minor + v2.cvs_minor
-cvs_serial = v1.cvs_serial + v2.cvs_serial
+from scipy_distutils.misc_util import default_config_dict
+from scipy_distutils.misc_util import get_path, merge_config_dicts
-scipy_core_version = '%(major)d.%(minor)d.%(micro)d_%(release_level)s'\
- '_%(cvs_minor)d.%(cvs_serial)d' % (locals ())
+bundle_packages = ['scipy_distutils','scipy_test','scipy_base']
+
+def get_package_config(name):
+ sys.path.insert(0,name)
+ try:
+ mod = __import__('setup_'+name)
+ config = mod.configuration()
+ finally:
+ del sys.path[0]
+ return config
+
+def get_package_version(name):
+ sys.path.insert(0,name)
+ try:
+ mod = __import__(name+'_version')
+ finally:
+ del sys.path[0]
+ return mod
+
+def setup_package():
+ old_path = os.getcwd()
+ path = get_path(__name__)
+ os.chdir(path)
+ sys.path.insert(0,path)
+
+ try:
+ config = map(get_package_config,bundle_packages)
+ config_dict = merge_config_dicts(config)
+
+ versions = map(get_package_version,bundle_packages)
+ major = max([v.major for v in versions])
+ minor = max([v.minor for v in versions])
+ micro = max([v.micro for v in versions])
+ release_level = min([v.release_level for v in versions])
+ cvs_minor = reduce(lambda a,b:a+b,[v.cvs_minor for v in versions],0)
+ cvs_serial = reduce(lambda a,b:a+b,[v.cvs_serial for v in versions],0)
+
+ scipy_core_version = '%(major)d.%(minor)d.%(micro)d'\
+ '_%(release_level)s'\
+ '_%(cvs_minor)d.%(cvs_serial)d' % (locals ())
+
+ print 'SciPy Core Version %s' % scipy_core_version
+ from scipy_distutils.core import setup
+ setup (name = "Scipy_core",
+ version = scipy_core_version,
+ maintainer = "SciPy Developers",
+ maintainer_email = "scipy-dev@scipy.org",
+ description = "SciPy core modules: scipy_{distutils,test,base}",
+ license = "SciPy License (BSD Style)",
+ url = "http://www.scipy.org",
+ **config_dict
+ )
+
+ finally:
+ del sys.path[0]
+ os.chdir(old_path)
if __name__ == "__main__":
- import os,sys
- from distutils.core import setup
- print 'SciPy core Version %s' % scipy_core_version
- setup (name = "SciPy_core",
- version = scipy_core_version,
- maintainer = "SciPy Developers",
- maintainer_email = "scipy-dev@scipy.org",
- description = "SciPy core modules: scipy_test and scipy_distutils",
- license = "SciPy License (BSD Style)",
- url = "http://www.scipy.org",
- packages=['scipy_distutils',
- 'scipy_distutils.command',
- 'scipy_test'],
- package_dir = {'scipy_distutils':'scipy_distutils',
- 'scipy_test':'scipy_test',
- },
- )
+ setup_package()

0 comments on commit e8fa013

Please sign in to comment.
Something went wrong with that request. Please try again.