|
|
|
@ -14,9 +14,20 @@ python setup.py sdist bdist_wininst upload --show-response
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
#!/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")
|
|
|
|
|
DISTUTILS_DEBUG = True
|
|
|
|
|
pkg_name = 'wafo'
|
|
|
|
@ -33,27 +44,84 @@ if True: #__file__ == 'setupegg.py':
|
|
|
|
|
else:
|
|
|
|
|
from distutils.core import setup
|
|
|
|
|
|
|
|
|
|
t = find_packages('src')
|
|
|
|
|
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]
|
|
|
|
|
# Return the svn version as a string, raise a ValueError otherwise
|
|
|
|
|
def svn_version():
|
|
|
|
|
from numpy.compat import asstr
|
|
|
|
|
|
|
|
|
|
env = os.environ.copy()
|
|
|
|
|
env['LC_ALL'] = 'C'
|
|
|
|
|
try:
|
|
|
|
|
out = subprocess.Popen(['svn', 'info'], stdout=subprocess.PIPE,
|
|
|
|
|
env=env).communicate()[0]
|
|
|
|
|
except OSError:
|
|
|
|
|
warnings.warn(" --- Could not run svn info --- ")
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
r = re.compile('Revision: ([0-9]+)')
|
|
|
|
|
svnver = None
|
|
|
|
|
for line in asstr(out).split('\n'):
|
|
|
|
|
m = r.match(line)
|
|
|
|
|
if m:
|
|
|
|
|
svnver = m.group(1)
|
|
|
|
|
|
|
|
|
|
if not svnver:
|
|
|
|
|
raise ValueError("Error while parsing svn version ?")
|
|
|
|
|
return svnver
|
|
|
|
|
|
|
|
|
|
FULLVERSION = VERSION
|
|
|
|
|
if not ISRELEASED:
|
|
|
|
|
FULLVERSION += '.dev'
|
|
|
|
|
# If in git or something, bypass the svn rev
|
|
|
|
|
if os.path.exists('.svn'):
|
|
|
|
|
FULLVERSION += svn_version()
|
|
|
|
|
|
|
|
|
|
testscripts = [os.path.join(subtst, f) for subtst in subtests
|
|
|
|
|
def write_version_py(filename='version.py'):
|
|
|
|
|
cnt = """\
|
|
|
|
|
# THIS FILE IS GENERATED FROM SETUP.PY
|
|
|
|
|
short_version='%(version)s'
|
|
|
|
|
version='%(version)s'
|
|
|
|
|
release=%(isrelease)s
|
|
|
|
|
"""
|
|
|
|
|
fid = open(os.path.join(rootdir,filename), 'w')
|
|
|
|
|
try:
|
|
|
|
|
fid.write(cnt % {'version': VERSION, 'isrelease': str(ISRELEASED)})
|
|
|
|
|
finally:
|
|
|
|
|
fid.close()
|
|
|
|
|
|
|
|
|
|
if __name__=='__main__':
|
|
|
|
|
write_version_py()
|
|
|
|
|
|
|
|
|
|
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'))]
|
|
|
|
|
datadir = 'data'
|
|
|
|
|
datafiles = [os.path.join(datadir, f) for f in os.listdir(os.path.join(root_dir, datadir))
|
|
|
|
|
|
|
|
|
|
#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']
|
|
|
|
|
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 = '0.11',
|
|
|
|
|
setup(
|
|
|
|
|
version = VERSION,
|
|
|
|
|
author='WAFO-group',
|
|
|
|
|
author_email='wafo@maths.lth.se',
|
|
|
|
|
decription = 'Statistical analysis and simulation of random waves and random loads',
|
|
|
|
@ -63,7 +131,7 @@ setup(
|
|
|
|
|
url='http://code.google.com/p/pywafo/',
|
|
|
|
|
name = pkg_name,
|
|
|
|
|
package_dir = {'': 'src'},
|
|
|
|
|
packages = find_packages('src'),
|
|
|
|
|
packages = packages,
|
|
|
|
|
package_data = {'': packagedata},
|
|
|
|
|
classifiers=[
|
|
|
|
|
'Development Status :: 4 - Beta',
|
|
|
|
|