Move to SCM driven version number derived from VCS instead of hard coded version
Change VERSION constant from semver list (e.g. [2, 2, 1]) to string version (e.g. 2.2.1) Remove STR_VERSION constant
This commit is contained in:
Родитель
534b46c4b9
Коммит
b189a1ecbd
|
@ -1,5 +1,5 @@
|
|||
# Copyright 2012-2016 Jonathan Paugh and contributors
|
||||
# See COPYING for license details
|
||||
from agithub.base import VERSION, STR_VERSION
|
||||
from agithub.base import VERSION
|
||||
|
||||
__all__ = ["VERSION", "STR_VERSION"]
|
||||
__all__ = ["VERSION"]
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# See COPYING for license details
|
||||
import json
|
||||
from functools import partial, update_wrapper
|
||||
from setuptools_scm import get_version
|
||||
|
||||
import sys
|
||||
if sys.version_info[0:2] > (3, 0):
|
||||
|
@ -14,14 +15,13 @@ else:
|
|||
class ConnectionError(OSError):
|
||||
pass
|
||||
|
||||
VERSION = [2, 1]
|
||||
STR_VERSION = 'v' + '.'.join(str(v) for v in VERSION)
|
||||
VERSION = get_version(root='..', relative_to=__file__)
|
||||
|
||||
# These headers are implicitly included in each request; however, each
|
||||
# can be explicitly overridden by the client code. (Used in Client
|
||||
# objects.)
|
||||
_default_headers = {
|
||||
'user-agent': 'agithub/' + STR_VERSION,
|
||||
'user-agent': 'agithub/' + VERSION,
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[egg_info]
|
||||
tag_build =
|
||||
tag_date = 0
|
||||
tag_svn_revision = 0
|
||||
|
12
setup.py
12
setup.py
|
@ -5,10 +5,13 @@ here = path.abspath(path.dirname(__file__))
|
|||
with open(path.join(here, 'README.md')) as f:
|
||||
long_description = f.read()
|
||||
|
||||
version = '2.2.0'
|
||||
test_requirements = ['pytest']
|
||||
|
||||
extras = {
|
||||
"test": test_requirements,
|
||||
}
|
||||
|
||||
setup(name='agithub',
|
||||
version=version,
|
||||
description="A lightweight, transparent syntax for REST clients",
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
|
@ -29,4 +32,9 @@ setup(name='agithub',
|
|||
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
tests_require=test_requirements,
|
||||
extras_require=extras,
|
||||
setup_requires=['setuptools-scm'],
|
||||
use_scm_version=True,
|
||||
install_requires=['setuptools-scm'],
|
||||
)
|
||||
|
|
Загрузка…
Ссылка в новой задаче