annotate setup.py @ 90:f58882dce2d7

Move README.txt to README.rst and tidy up Now reflects no dependencies, how to install using pip and how to use it. All other information has been discarded and can be found by looking in other files.
author Roy Marples <roy@marples.name>
date Tue, 19 Jan 2021 23:05:11 +0000
parents fec9b2b96c5f
children c305720d5b7c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
81
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
1 from os.path import dirname, join
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
2
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
3 try:
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
4 from setuptools import setup
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
5 except:
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
6 from distutils.core import setup
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
7
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
8 def get_version(relpath):
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
9 path = join(dirname(__file__), relpath)
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
10 for line in open(path, 'rb'):
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
11 line = line.decode('utf-8')
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
12 if '__version__' in line:
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
13 return line.split("'")[1]
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
14
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
15 py_packages = [
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
16 'hgext3rd',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
17 'hgext3rd.fastimport',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
18 ]
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
19
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
20 py_packagedir = {
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
21 'hgext3rd': join(dirname(__file__), 'hgext3rd')
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
22 }
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
23
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
24 py_versions = '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, <4'
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
25
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
26 setup(
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
27 name='hg-fastimport',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
28 version=get_version('hgext3rd/fastimport/__init__.py'),
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
29 author='The hg-fastimport authors',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
30 maintainer='Roy Marples',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
31 maintainer_email='roy@marples.name',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
32 url='https://roy.marples.name/hg/hg-fastimport/',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
33 description='Mercurial extension for importing from a git fast-import stream.',
90
f58882dce2d7 Move README.txt to README.rst and tidy up
Roy Marples <roy@marples.name>
parents: 81
diff changeset
34 long_description=open(join(dirname(__file__), 'README.rst')).read(),
81
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
35 keywords='hg git mercurial',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
36 license='GPLv2',
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
37 packages=py_packages,
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
38 package_dir=py_packagedir,
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
39 python_requires=py_versions,
fec9b2b96c5f Implement setup.py so that hg-fastimport can be packaged
Roy Marples <roy@marples.name>
parents:
diff changeset
40 )