summaryrefslogtreecommitdiffstats
path: root/third_party/python/python-hglib/setup.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/python-hglib/setup.py
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/python-hglib/setup.py')
-rw-r--r--third_party/python/python-hglib/setup.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/third_party/python/python-hglib/setup.py b/third_party/python/python-hglib/setup.py
new file mode 100644
index 0000000000..f565ae7f98
--- /dev/null
+++ b/third_party/python/python-hglib/setup.py
@@ -0,0 +1,54 @@
+import os, time
+from distutils.core import setup
+
+# query Mercurial for version number, or pull from PKG-INFO
+version = 'unknown'
+if os.path.isdir('.hg'):
+ cmd = "hg id -i -t"
+ l = os.popen(cmd).read().split()
+ while len(l) > 1 and l[-1][0].isalpha(): # remove non-numbered tags
+ l.pop()
+ if len(l) > 1: # tag found
+ version = l[-1]
+ if l[0].endswith('+'): # propagate the dirty status to the tag
+ version += '+'
+ elif len(l) == 1: # no tag found
+ cmd = 'hg parents --template "{latesttag}+{latesttagdistance}-"'
+ version = os.popen(cmd).read() + l[0]
+ if version.endswith('+'):
+ version += time.strftime('%Y%m%d')
+elif os.path.exists('.hg_archival.txt'):
+ kw = dict([[t.strip() for t in l.split(':', 1)]
+ for l in open('.hg_archival.txt')])
+ if 'tag' in kw:
+ version = kw['tag']
+ elif 'latesttag' in kw:
+ version = '%(latesttag)s+%(latesttagdistance)s-%(node).12s' % kw
+ else:
+ version = kw.get('node', '')[:12]
+elif os.path.exists('PKG-INFO'):
+ kw = dict([[t.strip() for t in l.split(':', 1)]
+ for l in open('PKG-INFO') if ':' in l])
+ version = kw.get('Version', version)
+
+setup(
+ name='python-hglib',
+ version=version,
+ author='Idan Kamara',
+ author_email='idankk86@gmail.com',
+ url='http://selenic.com/repo/python-hglib',
+ description='Mercurial Python library',
+ long_description=open(os.path.join(os.path.dirname(__file__),
+ 'README')).read(),
+ classifiers=[
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.4',
+ 'Programming Language :: Python :: 2.5',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.4',
+
+ ],
+ license='MIT',
+ packages=['hglib'])