use mercurial revision to construct version, when building a non-final version

This commit is contained in:
Pablo Hoffman 2010-06-14 08:59:20 -03:00
parent 68e8e6ac11
commit 2d3d5b6aba
1 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,13 @@ if len(sys.argv) > 1 and sys.argv[1] == 'bdist_wininst':
# Dynamically calculate the version based on scrapy.__version__
version = __import__('scrapy').__version__
if 'dev' in version:
try:
from subprocess import Popen, PIPE
hgrev = Popen(['hg', 'tip', '--template={rev}'], stdout=PIPE).communicate()[0]
version = version.replace('-dev', '-r%s' % hgrev)
except:
pass
setup_args = {
'name': 'Scrapy',