mirror of https://github.com/scrapy/scrapy.git
added support for generating version from git revision
This commit is contained in:
parent
bc2d2183e9
commit
3b00b9cb12
|
|
@ -16,7 +16,9 @@ def build(suffix):
|
|||
with open(ifn, 'w') as of:
|
||||
of.write(s)
|
||||
|
||||
check_call('debchange -m -D unstable --force-distribution -v $(python setup.py --version)-r$(hg tip --template "{rev}")+$(date +%s) "Automatic build"', shell=True)
|
||||
env={'SCRAPY_VERSION_FROM_GIT': '1'}
|
||||
check_call('debchange -m -D unstable --force-distribution -v $(python setup.py --version)+$(date +%s) "Automatic build"', \
|
||||
shell=True, env=env)
|
||||
check_call('debuild -us -uc -b', shell=True)
|
||||
|
||||
def clean(suffix):
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -86,6 +86,10 @@ if os.environ.get('SCRAPY_VERSION_FROM_HG'):
|
|||
rev = Popen(["hg", "tip", "--template", "{rev}"], stdout=PIPE).communicate()[0]
|
||||
with open('scrapy/__init__.py', 'a') as f:
|
||||
f.write("\n__version__ = '.'.join(map(str, version_info)) + '.%s'" % rev)
|
||||
elif os.environ.get('SCRAPY_VERSION_FROM_GIT'):
|
||||
rev = Popen("git log --oneline | wc -l", shell=True, stdout=PIPE).communicate()[0]
|
||||
with open('scrapy/__init__.py', 'a') as f:
|
||||
f.write("\n__version__ = '.'.join(map(str, version_info)) + '.%s'" % rev.strip())
|
||||
version = __import__('scrapy').__version__
|
||||
|
||||
setup_args = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue