mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-09 19:52:37 +01:00
Drop src/version.py from the source and generate it with setup.py instead. Closes GH-358.
This commit is contained in:
parent
86f541e6db
commit
90e511cad1
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ docs/plugins
|
|||||||
*.mo
|
*.mo
|
||||||
push.sh
|
push.sh
|
||||||
merge.sh
|
merge.sh
|
||||||
|
src/version.py
|
||||||
|
23
setup.py
23
setup.py
@ -45,13 +45,32 @@ while '--clean' in sys.argv:
|
|||||||
|
|
||||||
import glob
|
import glob
|
||||||
import shutil
|
import shutil
|
||||||
import os.path
|
import os
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from src.version import version
|
|
||||||
|
|
||||||
plugins = [s for s in os.listdir('plugins') if
|
plugins = [s for s in os.listdir('plugins') if
|
||||||
os.path.exists(os.path.join('plugins', s, 'plugin.py'))]
|
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):
|
def normalizeWhitespace(s):
|
||||||
return ' '.join(s.split())
|
return ' '.join(s.split())
|
||||||
|
|
||||||
|
@ -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)'
|
|
Loading…
Reference in New Issue
Block a user