Skip to content

Commit

Permalink
Add package __version__.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Oct 24, 2009
1 parent 714a49a commit c3dd1e4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ doc/build
source/api
scikits/image/opencv/*.new
build

scikits/image/version.py
1 change: 1 addition & 0 deletions scikits/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

data_dir = _osp.join(_osp.dirname(__file__), 'data')

from version import version as __version__
15 changes: 15 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,22 @@ def configuration(parent_package='', top_path=None):

return config

def write_version_py(filename='scikits/image/version.py'):
template = """# THIS FILE IS GENERATED FROM THE SCIKITS.IMAGE SETUP.PY
version='%s'
"""

vfile = open(os.path.join(os.path.dirname(__file__),
filename), 'w')

try:
vfile.write(template % VERSION)
finally:
vfile.close()

if __name__ == "__main__":
write_version_py()

setup(
name=DISTNAME,
description=DESCRIPTION,
Expand Down

0 comments on commit c3dd1e4

Please sign in to comment.