mirror of https://github.com/scrapy/scrapy.git
use mercurial revision to construct version, when building a non-final version
This commit is contained in:
parent
68e8e6ac11
commit
2d3d5b6aba
7
setup.py
7
setup.py
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue