From f089faab2cac14c7a40d257bc8a39c4b04c50fd2 Mon Sep 17 00:00:00 2001 From: Xing Wu Date: Wed, 9 May 2018 12:43:45 -0700 Subject: [PATCH] Update supported version (#60) --- azure/batch_extensions/version.py | 2 +- batch-cli-extensions/azext_batch/commands.py | 4 ++-- batch-cli-extensions/azext_batch/version.py | 2 +- batch-cli-extensions/setup.py | 13 ++++++++++--- requirements.txt | 2 +- scripts/dev_setup.py | 3 +++ setup.py | 14 ++++++++++---- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/azure/batch_extensions/version.py b/azure/batch_extensions/version.py index 5effe1c..6e90ba1 100644 --- a/azure/batch_extensions/version.py +++ b/azure/batch_extensions/version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -VERSION = "1.1.0" +VERSION = "1.1.1" diff --git a/batch-cli-extensions/azext_batch/commands.py b/batch-cli-extensions/azext_batch/commands.py index 662e004..6ef6d76 100644 --- a/batch-cli-extensions/azext_batch/commands.py +++ b/batch-cli-extensions/azext_batch/commands.py @@ -13,9 +13,9 @@ from azure.batch_extensions import __version__ as batch_ext_version logger = get_logger(__name__) -SUPPORTED_BATCH_VERSION = "4.1" +SUPPORTED_BATCH_VERSION = "4.2" SUPPORTED_BMGMT_VERSION = "4.2" -SUPPORTED_BATCH_EXT_VERSION = "1.1" +SUPPORTED_BATCH_EXT_VERSION = "1.2" def confirm_version(current, supported, package): diff --git a/batch-cli-extensions/azext_batch/version.py b/batch-cli-extensions/azext_batch/version.py index 71eb180..aa2fb4f 100644 --- a/batch-cli-extensions/azext_batch/version.py +++ b/batch-cli-extensions/azext_batch/version.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -VERSION = "2.1.0" +VERSION = "2.2.2" diff --git a/batch-cli-extensions/setup.py b/batch-cli-extensions/setup.py index f0c5e0a..475f7a8 100644 --- a/batch-cli-extensions/setup.py +++ b/batch-cli-extensions/setup.py @@ -6,11 +6,10 @@ # -------------------------------------------------------------------------------------------- import os +import re from codecs import open from setuptools import setup, find_packages -VERSION = '2.2.1' - # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ @@ -29,6 +28,14 @@ CLASSIFIERS = [ DEPENDENCIES = [] +# Version extraction inspired from 'requests' +with open(os.path.join('azext_batch', 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() with open('HISTORY.rst', 'r', encoding='utf-8') as f: @@ -36,7 +43,7 @@ with open('HISTORY.rst', 'r', encoding='utf-8') as f: setup( name='azure-batch-cli-extensions', - version=VERSION, + version=version, description='Additional commands for working with Azure Batch service', long_description=README + '\n\n' + HISTORY, license='MIT', diff --git a/requirements.txt b/requirements.txt index eda2443..512f6be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,5 +17,5 @@ setuptools==30.4.0 six==1.10.0 tabulate==0.7.5 vcrpy==1.10.3 -azure-cli==2.0.31 +azure-cli==2.0.32 azure-storage-blob==1.1.0 \ No newline at end of file diff --git a/scripts/dev_setup.py b/scripts/dev_setup.py index 9d498f9..087d1c3 100644 --- a/scripts/dev_setup.py +++ b/scripts/dev_setup.py @@ -30,6 +30,9 @@ print('Root directory \'{}\'\n'.format(root_dir)) # install general requirements and azure-cli exec_command('pip install -r requirements.txt') +# upgrade to latest azure-batch +exec_command('pip install --upgrade azure-batch') + # install automation package exec_command('pip install -e ./scripts') diff --git a/setup.py b/setup.py index 1fd9e42..4516609 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,11 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - +import os +import re from codecs import open from setuptools import setup -VERSION = '1.1.1' - # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ @@ -38,6 +37,13 @@ DEPENDENCIES_27 = { ":python_version<'3.4'": ['pathlib>=1.0.1'] } +# Version extraction inspired from 'requests' +with open(os.path.join('azure/batch_extensions', 'version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() @@ -46,7 +52,7 @@ with open('HISTORY.rst', 'r', encoding='utf-8') as f: setup( name='azure-batch-extensions', - version=VERSION, + version=version, description='Microsoft Azure Batch Extended Features', long_description=README + '\n\n' + HISTORY, license='MIT',