Skip to content

Commit

Permalink
Merge pull request clawpack#16 from ketch/master
Browse files Browse the repository at this point in the history
Update setup.py version and always make symlinks
  • Loading branch information
ketch committed Jul 26, 2013
2 parents bcb5319 + 1eadb4d commit 13b2247
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@
"""

MAJOR = 0
MINOR = 1
MAJOR = 5
MINOR = 0
MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
TYPE = 'rc-alpha'
VERSION = '%d.%d.%d%s' % (MAJOR, MINOR, MICRO, TYPE)

package_path = os.path.join(os.path.dirname(__file__),'clawpack')

Expand Down Expand Up @@ -139,10 +139,6 @@ def write_version_py(filename=version_file_path):
version = '%(version)s'
full_version = '%(full_version)s'
git_revision = '%(git_revision)s'
release = %(isrelease)s
if not release:
version = full_version
"""
# Adding the git rev number needs to be done inside
# write_version_py(), otherwise the import of clawpack.version messes
Expand All @@ -157,14 +153,10 @@ def write_version_py(filename=version_file_path):
else:
GIT_REVISION = "Unknown"

if not ISRELEASED:
FULLVERSION += '.dev-' + GIT_REVISION[:7]

with open(filename, 'w') as a:
a.write(cnt % {'version': VERSION,
'full_version' : FULLVERSION,
'git_revision' : GIT_REVISION,
'isrelease': str(ISRELEASED)})
'git_revision' : GIT_REVISION})

del sys.path[0]
os.chdir(old_path)
Expand Down Expand Up @@ -239,14 +231,18 @@ def dev_setup(subpackages):
"waiting 5s and trying again [fail %d/20]" % fails
time.sleep(5)

print "Git development environment initialized for:", package


def make_symlinks(subpackages):
for package, package_dict in subpackages.items():
for subpackage, src_dir in package_dict['python_src_dir']:
symlink(os.path.join(package, src_dir, subpackage),
os.path.join('clawpack', subpackage))
if 'fortran_src_dir' in package_dict:
symlink(os.path.join(package, package_dict['fortran_src_dir']),
os.path.join('clawpack', package, 'src'))

print "Git development environment initialized for:", package

def setup_package(setup_dict, subpackages):
from numpy.distutils.core import setup
Expand All @@ -262,6 +258,7 @@ def setup_package(setup_dict, subpackages):
try:
if os.path.exists('.git'):
dev_setup(subpackages)
make_symlinks(subpackages)
setup(configuration=configuration,
**setup_dict)
finally:
Expand Down

0 comments on commit 13b2247

Please sign in to comment.