Drop src/version.py from the source and generate it with setup.py instead. Closes GH-358.

This commit is contained in:
Valentin Lorentz 2012-05-11 18:43:23 +02:00
parent 86f541e6db
commit 90e511cad1
3 changed files with 22 additions and 5 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ docs/plugins
*.mo
push.sh
merge.sh
src/version.py

View File

@ -45,13 +45,32 @@ while '--clean' in sys.argv:
import glob
import shutil
import os.path
import os
import subprocess
from src.version import version
plugins = [s for s in os.listdir('plugins') if
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
try:
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
stdout=subprocess.PIPE)
version = proc.stdout.readline() \
.strip() \
.replace(' +', '+') \
.replace(' ', 'T')
try:
os.unlink(os.path.join('src', 'version.py'))
except OSError: # Does not exist
pass
open(os.path.join('src', 'version.py'), 'a').write(
"version = '0.83.4.1+limnoria %s'\n" % version)
except:
raise
from src.version import version
def normalizeWhitespace(s):
return ' '.join(s.split())

View File

@ -1,3 +0,0 @@
"""stick the various versioning attributes in here, so we only have to change
them once."""
version = '0.83.4.1+limnoria (2012-05-04T16:56:13+0000)'