From 2bac617dc98d6906751bdcd1a0d7964b5f8fe72a Mon Sep 17 00:00:00 2001 From: j Date: Thu, 27 Jul 2023 18:40:38 +0200 Subject: [PATCH] update to version 3 --- ox/__init__.py | 2 +- setup.py | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ox/__init__.py b/ox/__init__.py index 98402fb..4620e8f 100644 --- a/ox/__init__.py +++ b/ox/__init__.py @@ -5,7 +5,7 @@ try: from . import __version __version__ = __version.VERSION except: - __version__ = '2.3.x' + __version__ = '3.0.x' from . import cache from . import js diff --git a/setup.py b/setup.py index e76a325..b1d1de5 100644 --- a/setup.py +++ b/setup.py @@ -7,9 +7,10 @@ try: except: from distutils.core import setup -def get_revision(): +def get_git_version(): 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(): import os @@ -18,9 +19,8 @@ def get_version(): __version = os.path.join(os.path.dirname(__file__), 'ox/__version.py') changelog = os.path.join(os.path.dirname(__file__), 'debian/changelog') if os.path.exists(_git): - rev = get_revision() - if rev: - version = "2.3.%s" % rev + version = get_git_version() + if version: with open(__version, 'w') as fd: fd.write('VERSION="%s"' % version) return version @@ -37,8 +37,8 @@ def get_version(): f.close() rev = re.compile('\d+\.\d+\.(\d+)').findall(head) if rev: - return '2.3.%s' % rev[0] - return '2.3.x' + return '3.0.%s' % rev[0] + return '3.0.x' setup( @@ -56,11 +56,12 @@ setup( classifiers=[ 'Operating System :: OS Independent', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.7', + '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', ], )