-
Notifications
You must be signed in to change notification settings - Fork 18
/
metadata.py
26 lines (23 loc) · 740 Bytes
/
metadata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import subprocess
import os.path
try:
# don't get confused if our sdist is unzipped in a subdir of some
# other hg repo
if os.path.isdir('.hg'):
p = subprocess.Popen(['hg', 'parents', r'--template={rev}\n'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if not p.returncode:
fh = open('HGREV', 'w')
fh.write((p.communicate()[0].splitlines()[0] or '').decode('utf-8'))
fh.close()
except (OSError, IndexError):
pass
try:
hgrev = open('HGREV').read()
except IOError:
hgrev = ''
name = 'localeurl'
authors = 'Joost Cassee, Artiom Diomin and Carl Meyer'
copyright_years = '2008-2010'
version = '2.0.2.post%s' % hgrev
release = version