update to version 3

This commit is contained in:
j 2023-07-27 18:40:38 +02:00
parent 99e221095b
commit 2bac617dc9
2 changed files with 13 additions and 12 deletions

View file

@ -5,7 +5,7 @@ try:
from . import __version from . import __version
__version__ = __version.VERSION __version__ = __version.VERSION
except: except:
__version__ = '2.3.x' __version__ = '3.0.x'
from . import cache from . import cache
from . import js from . import js

View file

@ -7,9 +7,10 @@ try:
except: except:
from distutils.core import setup from distutils.core import setup
def get_revision(): def get_git_version():
import subprocess import subprocess
return subprocess.check_output(['git', 'rev-list', 'HEAD', '--count']).decode().strip() version = subprocess.check_output(['git', 'describe', '--tags']).decode().strip().replace('-', '.')
return '.'.join((version.split('.') + ['0'])[:3])
def get_version(): def get_version():
import os import os
@ -18,9 +19,8 @@ def get_version():
__version = os.path.join(os.path.dirname(__file__), 'ox/__version.py') __version = os.path.join(os.path.dirname(__file__), 'ox/__version.py')
changelog = os.path.join(os.path.dirname(__file__), 'debian/changelog') changelog = os.path.join(os.path.dirname(__file__), 'debian/changelog')
if os.path.exists(_git): if os.path.exists(_git):
rev = get_revision() version = get_git_version()
if rev: if version:
version = "2.3.%s" % rev
with open(__version, 'w') as fd: with open(__version, 'w') as fd:
fd.write('VERSION="%s"' % version) fd.write('VERSION="%s"' % version)
return version return version
@ -37,8 +37,8 @@ def get_version():
f.close() f.close()
rev = re.compile('\d+\.\d+\.(\d+)').findall(head) rev = re.compile('\d+\.\d+\.(\d+)').findall(head)
if rev: if rev:
return '2.3.%s' % rev[0] return '3.0.%s' % rev[0]
return '2.3.x' return '3.0.x'
setup( setup(
@ -56,11 +56,12 @@ setup(
classifiers=[ classifiers=[
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python', 'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Software Development :: Libraries :: Python Modules',
], ],
) )