Mercurial > hg > hg-fastimport
comparison setup.py @ 81:fec9b2b96c5f
Implement setup.py so that hg-fastimport can be packaged
With either distutils or setuptools.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Mon, 18 Jan 2021 23:21:11 +0000 |
| parents | |
| children | f58882dce2d7 |
comparison
equal
deleted
inserted
replaced
| 80:dc1d11466aa6 | 81:fec9b2b96c5f |
|---|---|
| 1 from os.path import dirname, join | |
| 2 | |
| 3 try: | |
| 4 from setuptools import setup | |
| 5 except: | |
| 6 from distutils.core import setup | |
| 7 | |
| 8 def get_version(relpath): | |
| 9 path = join(dirname(__file__), relpath) | |
| 10 for line in open(path, 'rb'): | |
| 11 line = line.decode('utf-8') | |
| 12 if '__version__' in line: | |
| 13 return line.split("'")[1] | |
| 14 | |
| 15 py_packages = [ | |
| 16 'hgext3rd', | |
| 17 'hgext3rd.fastimport', | |
| 18 ] | |
| 19 | |
| 20 py_packagedir = { | |
| 21 'hgext3rd': join(dirname(__file__), 'hgext3rd') | |
| 22 } | |
| 23 | |
| 24 py_versions = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4' | |
| 25 | |
| 26 setup( | |
| 27 name='hg-fastimport', | |
| 28 version=get_version('hgext3rd/fastimport/__init__.py'), | |
| 29 author='The hg-fastimport authors', | |
| 30 maintainer='Roy Marples', | |
| 31 maintainer_email='roy@marples.name', | |
| 32 url='https://roy.marples.name/hg/hg-fastimport/', | |
| 33 description='Mercurial extension for importing from a git fast-import stream.', | |
| 34 long_description=open(join(dirname(__file__), 'README.txt')).read(), | |
| 35 keywords='hg git mercurial', | |
| 36 license='GPLv2', | |
| 37 packages=py_packages, | |
| 38 package_dir=py_packagedir, | |
| 39 python_requires=py_versions, | |
| 40 ) |
