|
|
@ -14,9 +14,20 @@ python setup.py sdist bdist_wininst upload --show-response
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
#!/usr/bin/env python
|
|
|
|
#!/usr/bin/env python
|
|
|
|
import os, sys
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#sys.argv.append("develop")
|
|
|
|
import os
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MAJOR = 0
|
|
|
|
|
|
|
|
MINOR = 1
|
|
|
|
|
|
|
|
MICRO = 1
|
|
|
|
|
|
|
|
ISRELEASED = False
|
|
|
|
|
|
|
|
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sys.argv.append("develop")
|
|
|
|
#sys.argv.append("install")
|
|
|
|
#sys.argv.append("install")
|
|
|
|
DISTUTILS_DEBUG = True
|
|
|
|
DISTUTILS_DEBUG = True
|
|
|
|
pkg_name = 'wafo'
|
|
|
|
pkg_name = 'wafo'
|
|
|
@ -33,52 +44,109 @@ if True: #__file__ == 'setupegg.py':
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
from distutils.core import setup
|
|
|
|
from distutils.core import setup
|
|
|
|
|
|
|
|
|
|
|
|
t = find_packages('src')
|
|
|
|
|
|
|
|
subpackages = ('spectrum','data','transform','covariance')
|
|
|
|
# Return the svn version as a string, raise a ValueError otherwise
|
|
|
|
#subpackagesfull = [os.path.join(pkg_name,f) for f in subpackages]
|
|
|
|
def svn_version():
|
|
|
|
|
|
|
|
from numpy.compat import asstr
|
|
|
|
subtests = [os.path.join(subpkg,'test') for subpkg in subpackages]
|
|
|
|
|
|
|
|
|
|
|
|
env = os.environ.copy()
|
|
|
|
testscripts = [os.path.join(subtst, f) for subtst in subtests
|
|
|
|
env['LC_ALL'] = 'C'
|
|
|
|
for f in os.listdir(os.path.join(root_dir, subtst))
|
|
|
|
try:
|
|
|
|
if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
out = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE,
|
|
|
|
f.endswith('.old') or f.endswith('.bak'))]
|
|
|
|
env=env).communicate()[0]
|
|
|
|
datadir = 'data'
|
|
|
|
except OSError:
|
|
|
|
datafiles = [os.path.join(datadir, f) for f in os.listdir(os.path.join(root_dir, datadir))
|
|
|
|
warnings.warn(" --- Could not run svn info --- ")
|
|
|
|
if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
return ""
|
|
|
|
f.endswith('.old') or f.endswith('.bak') or
|
|
|
|
|
|
|
|
f.endswith('.py') or f.endswith('test') )]
|
|
|
|
r = re.compile('Revision: ([0-9]+)')
|
|
|
|
libs = [f for f in os.listdir(os.path.join(root_dir)) if f.endswith('.pyd') ]
|
|
|
|
svnver = None
|
|
|
|
packagedata = testscripts + datafiles + libs #['c_library.pyd'] #,'disufq1.c','diffsumfunq.pyd','diffsumfunq.pyf','findrfc.c','rfc.pyd','rfc.pyf']
|
|
|
|
for line in asstr(out).split('\n'):
|
|
|
|
|
|
|
|
m = r.match(line)
|
|
|
|
|
|
|
|
if m:
|
|
|
|
setup(
|
|
|
|
svnver = m.group(1)
|
|
|
|
version = '0.11',
|
|
|
|
|
|
|
|
author='WAFO-group',
|
|
|
|
if not svnver:
|
|
|
|
author_email='wafo@maths.lth.se',
|
|
|
|
raise ValueError("Error while parsing svn version ?")
|
|
|
|
decription = 'Statistical analysis and simulation of random waves and random loads',
|
|
|
|
return svnver
|
|
|
|
long_description = info.__doc__,
|
|
|
|
|
|
|
|
install_requires = ['numpy>=1.4','numdifftools>=0.2'],
|
|
|
|
FULLVERSION = VERSION
|
|
|
|
license = "GPL",
|
|
|
|
if not ISRELEASED:
|
|
|
|
url='http://code.google.com/p/pywafo/',
|
|
|
|
FULLVERSION += '.dev'
|
|
|
|
name = pkg_name,
|
|
|
|
# If in git or something, bypass the svn rev
|
|
|
|
package_dir = {'': 'src'},
|
|
|
|
if os.path.exists('.svn'):
|
|
|
|
packages = find_packages('src'),
|
|
|
|
FULLVERSION += svn_version()
|
|
|
|
package_data = {'': packagedata},
|
|
|
|
|
|
|
|
classifiers=[
|
|
|
|
def write_version_py(filename='version.py'):
|
|
|
|
'Development Status :: 4 - Beta',
|
|
|
|
cnt = """\
|
|
|
|
'Intended Audience :: Education',
|
|
|
|
# THIS FILE IS GENERATED FROM SETUP.PY
|
|
|
|
'Intended Audience :: Science/Research',
|
|
|
|
short_version='%(version)s'
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
version='%(version)s'
|
|
|
|
'Operating System :: Microsoft :: Windows',
|
|
|
|
release=%(isrelease)s
|
|
|
|
'Programming Language :: Python :: 2.6',
|
|
|
|
"""
|
|
|
|
'Topic :: Scientific/Engineering :: Mathematics',
|
|
|
|
fid = open(os.path.join(rootdir,filename), 'w')
|
|
|
|
],
|
|
|
|
try:
|
|
|
|
#packages = [package_name,] + list(subpackagesfull),
|
|
|
|
fid.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
|
|
|
|
#package_data = {package_name: packagedata},
|
|
|
|
finally:
|
|
|
|
#package_data = {'': ['wafo.cfg']},
|
|
|
|
fid.close()
|
|
|
|
#scripts = [os.path.join('bin', f)
|
|
|
|
|
|
|
|
# for f in os.listdir('bin')
|
|
|
|
if __name__=='__main__':
|
|
|
|
# if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
write_version_py()
|
|
|
|
# f.endswith('.old') or f.endswith('.bak'))],
|
|
|
|
|
|
|
|
)
|
|
|
|
packages = find_packages('src')
|
|
|
|
|
|
|
|
package_paths =[p.replace(pkg_name,+'.','').replace(pkg_name,'').replace('.',os.path.sep)
|
|
|
|
|
|
|
|
for p in packages]
|
|
|
|
|
|
|
|
test_paths = [os.path.join(pkg_path,'test') for pkg_path in package_paths
|
|
|
|
|
|
|
|
if os.path.exists(os.path.join(root_dir,pkg_path,'test'))]
|
|
|
|
|
|
|
|
testscripts = [os.path.join(subtst, f) for subtst in test_paths
|
|
|
|
|
|
|
|
for f in os.listdir(os.path.join(root_dir, subtst))
|
|
|
|
|
|
|
|
if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
|
|
|
|
f.endswith('.old') or f.endswith('.bak'))]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#subpackages = ('spectrum','data','transform','covariance')
|
|
|
|
|
|
|
|
#subpackagesfull = [os.path.join(pkg_name,f) for f in subpackages]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#subtests = [os.path.join(subpkg,'test') for subpkg in subpackages]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#testscripts = [os.path.join(subtst, f) for subtst in subtests
|
|
|
|
|
|
|
|
# for f in os.listdir(os.path.join(root_dir, subtst))
|
|
|
|
|
|
|
|
# if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
|
|
|
|
# f.endswith('.old') or f.endswith('.bak'))]
|
|
|
|
|
|
|
|
datadir = 'data'
|
|
|
|
|
|
|
|
datafiles = [os.path.join(datadir, f) for f in os.listdir(os.path.join(root_dir, datadir))
|
|
|
|
|
|
|
|
if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
|
|
|
|
f.endswith('.old') or f.endswith('.bak') or
|
|
|
|
|
|
|
|
f.endswith('.py') or f.endswith('test') )]
|
|
|
|
|
|
|
|
libs = [f for f in os.listdir(os.path.join(root_dir)) if f.endswith('.pyd') ]
|
|
|
|
|
|
|
|
packagedata = testscripts + datafiles + libs #['c_library.pyd'] #,'disufq1.c','diffsumfunq.pyd','diffsumfunq.pyf','findrfc.c','rfc.pyd','rfc.pyf']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setup(
|
|
|
|
|
|
|
|
version = VERSION,
|
|
|
|
|
|
|
|
author='WAFO-group',
|
|
|
|
|
|
|
|
author_email='wafo@maths.lth.se',
|
|
|
|
|
|
|
|
decription = 'Statistical analysis and simulation of random waves and random loads',
|
|
|
|
|
|
|
|
long_description = info.__doc__,
|
|
|
|
|
|
|
|
install_requires = ['numpy>=1.4','numdifftools>=0.2'],
|
|
|
|
|
|
|
|
license = "GPL",
|
|
|
|
|
|
|
|
url='http://code.google.com/p/pywafo/',
|
|
|
|
|
|
|
|
name = pkg_name,
|
|
|
|
|
|
|
|
package_dir = {'': 'src'},
|
|
|
|
|
|
|
|
packages = packages,
|
|
|
|
|
|
|
|
package_data = {'': packagedata},
|
|
|
|
|
|
|
|
classifiers=[
|
|
|
|
|
|
|
|
'Development Status :: 4 - Beta',
|
|
|
|
|
|
|
|
'Intended Audience :: Education',
|
|
|
|
|
|
|
|
'Intended Audience :: Science/Research',
|
|
|
|
|
|
|
|
'License :: OSI Approved :: GNU General Public License (GPL)',
|
|
|
|
|
|
|
|
'Operating System :: Microsoft :: Windows',
|
|
|
|
|
|
|
|
'Programming Language :: Python :: 2.6',
|
|
|
|
|
|
|
|
'Topic :: Scientific/Engineering :: Mathematics',
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
#packages = [package_name,] + list(subpackagesfull),
|
|
|
|
|
|
|
|
#package_data = {package_name: packagedata},
|
|
|
|
|
|
|
|
#package_data = {'': ['wafo.cfg']},
|
|
|
|
|
|
|
|
#scripts = [os.path.join('bin', f)
|
|
|
|
|
|
|
|
# for f in os.listdir('bin')
|
|
|
|
|
|
|
|
# if not (f.startswith('.') or f.endswith('~') or
|
|
|
|
|
|
|
|
# f.endswith('.old') or f.endswith('.bak'))],
|
|
|
|
|
|
|
|
)
|
|
|
|