Added version generation to setup.py

Simplified __init__.py files to avoid duplicate inclusion of wafo.
master
Per.Andreas.Brodtkorb 14 years ago
parent 71852984c7
commit 51de2e3530

@ -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'))],
)

@ -4,6 +4,7 @@ gendocwafo.py
manifest manifest
setup.py setup.py
setup_old.py setup_old.py
test_all.py
src/epydoc_wafo.prj src/epydoc_wafo.prj
src/Wafo.egg-info/PKG-INFO src/Wafo.egg-info/PKG-INFO
src/Wafo.egg-info/SOURCES.txt src/Wafo.egg-info/SOURCES.txt
@ -12,7 +13,6 @@ src/Wafo.egg-info/top_level.txt
src/wafo/SpecData1D.mm src/wafo/SpecData1D.mm
src/wafo/__init__.py src/wafo/__init__.py
src/wafo/c_library.pyd src/wafo/c_library.pyd
src/wafo/data_structures.py
src/wafo/dctpack.py src/wafo/dctpack.py
src/wafo/definitions.py src/wafo/definitions.py
src/wafo/definitions.~py src/wafo/definitions.~py
@ -25,18 +25,14 @@ src/wafo/kdetools.py
src/wafo/meshgrid.py src/wafo/meshgrid.py
src/wafo/misc.py src/wafo/misc.py
src/wafo/mvn.pyd src/wafo/mvn.pyd
src/wafo/mvn.pyf
src/wafo/mvndst.f
src/wafo/mvnprdmod.pyd src/wafo/mvnprdmod.pyd
src/wafo/namedtuple.py src/wafo/namedtuple.py
src/wafo/objects.py src/wafo/objects.py
src/wafo/plotbackend.py src/wafo/plotbackend.py
src/wafo/polynomial.py src/wafo/polynomial.py
src/wafo/polynomial_old.py src/wafo/polynomial_old.py
src/wafo/ppimport.py
src/wafo/rindmod.pyd src/wafo/rindmod.pyd
src/wafo/sg_filter.py src/wafo/sg_filter.py
src/wafo/test_ppimport.py
src/wafo/wafodata.py src/wafo/wafodata.py
src/wafo.egg-info/SOURCES.txt src/wafo.egg-info/SOURCES.txt
src/wafo/covariance/__init__.py src/wafo/covariance/__init__.py
@ -100,6 +96,10 @@ src/wafo/source/mreg/rintmod.mod
src/wafo/source/mreg/sizemod.mod src/wafo/source/mreg/sizemod.mod
src/wafo/source/mreg/svd.mod src/wafo/source/mreg/svd.mod
src/wafo/source/mreg/tbrmod.mod src/wafo/source/mreg/tbrmod.mod
src/wafo/source/mvn/build_all.py
src/wafo/source/mvn/mvn.pyd
src/wafo/source/mvn/mvn.pyf
src/wafo/source/mvn/mvndst.f
src/wafo/source/mvnprd/adaptivegausskronrod.mod src/wafo/source/mvnprd/adaptivegausskronrod.mod
src/wafo/source/mvnprd/build_all.py src/wafo/source/mvnprd/build_all.py
src/wafo/source/mvnprd/erfcoremod.mod src/wafo/source/mvnprd/erfcoremod.mod
@ -264,9 +264,15 @@ src/wafo/stats/distributions.py
src/wafo/stats/distributions_juli2010.py src/wafo/stats/distributions_juli2010.py
src/wafo/stats/estimation.py src/wafo/stats/estimation.py
src/wafo/stats/misc.py src/wafo/stats/misc.py
src/wafo/stats/plotbackend.py src/wafo/stats/twolumps.py
src/wafo/test/__init__.py src/wafo/test/__init__.py
src/wafo/test/test_gaussian.py
src/wafo/test/test_misc.py
src/wafo/test/test_objects.py
src/wafo/transform/__init__.py src/wafo/transform/__init__.py
src/wafo/transform/core.py src/wafo/transform/core.py
src/wafo/transform/models.py src/wafo/transform/models.py
src/wafo/transform/models.~py src/wafo/transform/models.~py
src/wafo/transform/test/__init__.py
src/wafo/transform/test/test_models.py
src/wafo/transform/test/test_trdata.py

@ -1,10 +1,18 @@
from info import __doc__ from info import __doc__
import wafo.misc import misc
import wafo.data import data
import wafo.objects import objects
import wafo.spectrum import spectrum
import wafo.transform import transform
import wafo.definitions import definitions
import wafo.polynomial import polynomial
import wafo.stats import stats
try:
from wafo.version import version as __version__
except ImportError:
__version__='nobuilt'
from numpy.testing import Tester
test = Tester().test

@ -1,3 +1,3 @@
from wafo.data.info import __doc__ from info import __doc__
from wafo.data.info import * from info import *

@ -5,6 +5,6 @@ Spectrum package in WAFO Toolbox.
""" """
from wafo.spectrum.core import SpecData1D from core import SpecData1D
import wafo.spectrum.models import models
import wafo.spectrum.dispersion_relation import dispersion_relation

@ -5,5 +5,5 @@ Statistics package in WAFO Toolbox.
""" """
from scipy.stats import * from scipy.stats import *
from wafo.stats.core import * from core import *
from wafo.stats.distributions import * from wafo.stats.distributions import *

@ -2,5 +2,5 @@
Transform package in WAFO Toolbox. Transform package in WAFO Toolbox.
""" """
from wafo.transform.core import * from core import *
import wafo.transform.models import models

Loading…
Cancel
Save