1 # Copied from histedit setup.py |
1 # Copied from histedit setup.py |
2 # Credit to Augie Fackler <durin42@gmail.com> |
2 # Credit to Augie Fackler <durin42@gmail.com> |
3 |
3 |
4 from distutils.core import setup |
4 from distutils.core import setup |
|
5 from os.path import dirname, join |
|
6 |
|
7 def get_version(relpath): |
|
8 '''Read version info from a file without importing it''' |
|
9 for line in open(join(dirname(__file__), relpath), 'rb'): |
|
10 # Decode to a fail-safe string for PY3 |
|
11 # (gives unicode object in PY2) |
|
12 line = line.decode('utf8') |
|
13 if '__version__' in line: |
|
14 if "'" in line: |
|
15 return line.split("'")[1] |
5 |
16 |
6 setup( |
17 setup( |
7 name='hg-evolve', |
18 name='hg-evolve', |
8 version='5.0.0', |
19 version=get_version('hgext/evolve.py'), |
9 author='Pierre-Yves David', |
20 author='Pierre-Yves David', |
10 maintainer='Pierre-Yves David', |
21 maintainer='Pierre-Yves David', |
11 maintainer_email='pierre-yves.david@ens-lyon.org', |
22 maintainer_email='pierre-yves.david@ens-lyon.org', |
12 url='https://bitbucket.org/marmoute/mutable-history', |
23 url='https://bitbucket.org/marmoute/mutable-history', |
13 description='Flexible evolution of Mercurial history.', |
24 description='Flexible evolution of Mercurial history.', |