author | Pierre-Yves David <pierre-yves.david@fb.com> |
Wed, 07 Jan 2015 15:24:47 -0800 | |
changeset 1193 | de73285cf504 |
parent 1149 | a206ee74f129 |
child 1242 | cf846d47bb7e |
permissions | -rw-r--r-- |
496
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
1 |
# Copied from histedit setup.py |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
2 |
# Credit to Augie Fackler <durin42@gmail.com> |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
3 |
|
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
4 |
from distutils.core import setup |
1149
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
5 |
from os.path import dirname, join |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
6 |
|
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
7 |
def get_version(relpath): |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
8 |
'''Read version info from a file without importing it''' |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
9 |
for line in open(join(dirname(__file__), relpath), 'rb'): |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
10 |
# Decode to a fail-safe string for PY3 |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
11 |
# (gives unicode object in PY2) |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
12 |
line = line.decode('utf8') |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
13 |
if '__version__' in line: |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
14 |
if "'" in line: |
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
15 |
return line.split("'")[1] |
496
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
16 |
|
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
17 |
setup( |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
18 |
name='hg-evolve', |
1149
a206ee74f129
evolve: add various version info to save time on troubleshooting
anatoly techtonik <techtonik@gmail.com>
parents:
1138
diff
changeset
|
19 |
version=get_version('hgext/evolve.py'), |
496
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
20 |
author='Pierre-Yves David', |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
21 |
maintainer='Pierre-Yves David', |
916
48e68d3b0144
fix maintainer email
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
859
diff
changeset
|
22 |
maintainer_email='pierre-yves.david@ens-lyon.org', |
496
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
23 |
url='https://bitbucket.org/marmoute/mutable-history', |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
24 |
description='Flexible evolution of Mercurial history.', |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
25 |
long_description=open('README').read(), |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
26 |
keywords='hg mercurial', |
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
27 |
license='GPLv2+', |
969
1aba711b1c60
pkg: drop pushexperiment from the install list
Pierre-Yves David <pierre-yves.david@fb.com>
parents:
935
diff
changeset
|
28 |
py_modules=['hgext.evolve'], |
496
d3d9df795b4d
[pkg] Add a setup.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
29 |
) |