diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/setup.py	Mon Jan 18 23:21:11 2021 +0000
@@ -0,0 +1,40 @@
+from os.path import dirname, join
+
+try:
+    from setuptools import setup
+except:
+    from distutils.core import setup
+
+def get_version(relpath):
+    path = join(dirname(__file__), relpath)
+    for line in open(path, 'rb'):
+        line = line.decode('utf-8')
+        if '__version__' in line:
+            return line.split("'")[1]
+
+py_packages = [
+    'hgext3rd',
+    'hgext3rd.fastimport',
+]
+
+py_packagedir = {
+    'hgext3rd': join(dirname(__file__), 'hgext3rd')
+}
+
+py_versions = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4'
+
+setup(
+    name='hg-fastimport',
+    version=get_version('hgext3rd/fastimport/__init__.py'),
+    author='The hg-fastimport authors',
+    maintainer='Roy Marples',
+    maintainer_email='roy@marples.name',
+    url='https://roy.marples.name/hg/hg-fastimport/',
+    description='Mercurial extension for importing from a git fast-import stream.',
+    long_description=open(join(dirname(__file__), 'README.txt')).read(),
+    keywords='hg git mercurial',
+    license='GPLv2',
+    packages=py_packages,
+    package_dir=py_packagedir,
+    python_requires=py_versions,
+)