setup.py
author Pierre-Yves David <pierre-yves.david@fb.com>
Sat, 11 Apr 2015 10:35:26 -0400
branchstable
changeset 1252 d001376b0c09
parent 1149 a206ee74f129
child 1242 cf846d47bb7e
permissions -rw-r--r--
simple4server: cleanup debug output The debug output got duplicated with the original code. And the cleanup forgot about simple4serve. (code duplicated yeah!)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
)