mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 02:54:05 +01:00
Drop the '0.83.4.1+limnoria' part of version numbers, and make packages use the actual version instead of install time.
This commit is contained in:
parent
c260a76e06
commit
661a32d1a9
26
setup.py
26
setup.py
@ -46,6 +46,7 @@ if debug:
|
|||||||
if path:
|
if path:
|
||||||
os.chdir(path)
|
os.chdir(path)
|
||||||
|
|
||||||
|
VERSION_FILE = os.path.join('src', 'version.py')
|
||||||
version = None
|
version = None
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
proc = subprocess.Popen('git show HEAD --format=%ci', shell=True,
|
||||||
@ -65,19 +66,24 @@ try:
|
|||||||
utc_date = date - offset
|
utc_date = date - offset
|
||||||
version = utc_date.strftime('%Y.%m.%d')
|
version = utc_date.strftime('%Y.%m.%d')
|
||||||
except:
|
except:
|
||||||
pass
|
if os.path.isfile(VERSION_FILE):
|
||||||
if not version:
|
from src.version import version
|
||||||
from time import gmtime, strftime
|
else:
|
||||||
version = 'installed on ' + strftime("%Y-%m-%dT%H-%M-%S", gmtime())
|
from time import gmtime, strftime
|
||||||
|
version = 'installed on ' + strftime("%Y-%m-%dT%H-%M-%S", gmtime())
|
||||||
try:
|
try:
|
||||||
os.unlink(os.path.join('src', 'version.py'))
|
os.unlink(VERSION_FILE)
|
||||||
except OSError: # Does not exist
|
except OSError: # Does not exist
|
||||||
pass
|
pass
|
||||||
fd = open(os.path.join('src', 'version.py'), 'a')
|
if version:
|
||||||
fd.write('import supybot.utils.python\n')
|
fd = open(os.path.join('src', 'version.py'), 'a')
|
||||||
fd.write("version = '0.83.4.1+limnoria %s'\n" % version)
|
fd.write("version = '%s'\n" % version)
|
||||||
fd.write('supybot.utils.python._debug_software_version = version\n')
|
fd.write('try: # For import from setup.py\n')
|
||||||
fd.close()
|
fd.write(' import supybot.utils.python\n')
|
||||||
|
fd.write(' supybot.utils.python._debug_software_version = version\n')
|
||||||
|
fd.write('except ImportError:\n')
|
||||||
|
fd.write(' pass\n')
|
||||||
|
fd.close()
|
||||||
|
|
||||||
if sys.version_info < (2, 6, 0):
|
if sys.version_info < (2, 6, 0):
|
||||||
sys.stderr.write("Supybot requires Python 2.6 or newer.")
|
sys.stderr.write("Supybot requires Python 2.6 or newer.")
|
||||||
|
Loading…
Reference in New Issue
Block a user