Skip to content

Commit 5e5742d

Browse files
authored
Merge pull request Azure#645 from lmazuel/versionextract
Versionextract
2 parents 185d6f9 + e2eb22b commit 5e5742d

File tree

45 files changed

+211
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+211
-77
lines changed

azure-batch/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/batch/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-batch',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Batch Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-graphrbac/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/graphrbac/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-graphrbac',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Graph RBAC Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-authorization/azure/mgmt/authorization/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
# regenerated.
2020
# --------------------------------------------------------------------------
2121

22-
VERSION = "2015-07-01"
22+
VERSION = "0.30.0rc5"
2323

azure-mgmt-authorization/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/authorization/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-authorization',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Authorization Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-batch/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/batch/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-batch',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Batch Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-cdn/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/cdn/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-cdn',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure CDN Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
# regenerated.
2020
# --------------------------------------------------------------------------
2121

22-
VERSION = "2016-02-01-preview"
22+
VERSION = "0.30.0rc5"
2323

azure-mgmt-cognitiveservices/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/cognitiveservices/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-cognitiveservices',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Cognitive Services Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-commerce/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/commerce/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-commerce',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure commerce Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-compute/azure/mgmt/compute/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
# regenerated.
2020
# --------------------------------------------------------------------------
2121

22-
VERSION = ""
22+
VERSION = "0.30.0rc5"
2323

azure-mgmt-compute/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/compute/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-compute',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Compute Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-logic/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/logic/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-logic',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Logic Apps Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-network/azure/mgmt/network/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
# regenerated.
2020
# --------------------------------------------------------------------------
2121

22-
VERSION = "2016-03-30"
22+
VERSION = "0.30.0rc5"
2323

azure-mgmt-network/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/network/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-network',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Network Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-notificationhubs/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/notificationhubs/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-notificationhubs',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Notification Hubs Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-powerbiembedded/azure/mgmt/powerbiembedded/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
# regenerated.
2020
# --------------------------------------------------------------------------
2121

22-
VERSION = "2016-01-29"
22+
VERSION = "0.30.0rc5"
2323

azure-mgmt-powerbiembedded/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/powerbiembedded/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-powerbiembedded',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure PowerBI Embedded Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-redis/setup.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#--------------------------------------------------------------------------
1717

1818
from setuptools import setup
19+
import re
1920

2021
# azure v0.x is not compatible with this package
2122
# azure v0.x used to have a __version__ attribute (newer versions don't)
@@ -32,9 +33,17 @@
3233
except ImportError:
3334
pass
3435

36+
# Version extraction inspired from 'requests'
37+
with open('azure/mgmt/redis/version.py', 'r') as fd:
38+
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
39+
fd.read(), re.MULTILINE).group(1)
40+
41+
if not version:
42+
raise RuntimeError('Cannot find version information')
43+
3544
setup(
3645
name='azure-mgmt-redis',
37-
version='0.30.0rc4',
46+
version=version,
3847
description='Microsoft Azure Redis Cache Resource Management Client Library for Python',
3948
long_description=open('README.rst', 'r').read(),
4049
license='Apache License 2.0',

azure-mgmt-resource/azure/mgmt/resource/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22
from .locks import ManagementLockClient
33
from .policy import PolicyClient
44
from .resources import ResourceManagementClient
5-
from .subscriptions import SubscriptionClient
5+
from .subscriptions import SubscriptionClient
6+
7+
from .version import VERSION
8+
9+
__version__ = VERSION
10+

0 commit comments

Comments
 (0)