diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1dfe152..a1bfef7 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.0a20 +current_version = 1.0.0a21 parse = (?P\d+)\.(?P\d+)\.(?P\d+)((?P[a-z]+))(?P\d+) serialize = {major}.{minor}.{patch}{release}{release_version} diff --git a/mssqlscripter/__init__.py b/mssqlscripter/__init__.py index d9c4452..fcbf477 100644 --- a/mssqlscripter/__init__.py +++ b/mssqlscripter/__init__.py @@ -3,4 +3,4 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -__version__ = '1.0.0a20' +__version__ = '1.0.0a21' diff --git a/mssqltoolsservice/buildwheels.py b/mssqltoolsservice/buildwheels.py index b02f215..9f3d986 100644 --- a/mssqltoolsservice/buildwheels.py +++ b/mssqltoolsservice/buildwheels.py @@ -17,20 +17,14 @@ from urllib.request import urlopen -DOWNLOAD_URL_BASE = 'https://mssqlscripter.blob.core.windows.net/sqltoolsservice-08-16-2017/' +DOWNLOAD_URL_BASE = 'https://mssqlscripter.blob.core.windows.net/sqltoolsservice-10-12-2017/' # Supported platform key's must match those in mssqlscript's setup.py. SUPPORTED_PLATFORMS = { - 'CentOS_7': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-centos-x64-netcoreapp2.0.tar.gz', - 'Debian_8': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-debian-x64-netcoreapp2.0.tar.gz', - 'Fedora_23': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-fedora-x64-netcoreapp2.0.tar.gz', - 'openSUSE_13_2': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-opensuse-x64-netcoreapp2.0.tar.gz', - 'OSX_10_11_64': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-osx-x64-netcoreapp2.0.tar.gz', - 'RHEL_7': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-rhel-x64-netcoreapp2.0.tar.gz', - 'Ubuntu_14': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-ubuntu14-x64-netcoreapp2.0.tar.gz', - 'Ubuntu_16': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-ubuntu16-x64-netcoreapp2.0.tar.gz', - 'Windows_7_64': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-win-x64-netcoreapp2.0.zip', - 'Windows_7_86': DOWNLOAD_URL_BASE + 'microsoft.sqltools.servicelayer-win-x86-netcoreapp2.0.zip' + 'Linux_64': DOWNLOAD_URL_BASE + 'Microsoft.SqlTools.ServiceLayer-linux-x64-netcoreapp2.0.tar.gz', + 'OSX_10_11_64': DOWNLOAD_URL_BASE + 'Microsoft.SqlTools.ServiceLayer-osx-x64-netcoreapp2.0.tar.gz', + 'Windows_7_64': DOWNLOAD_URL_BASE + 'Microsoft.SqlTools.ServiceLayer-win-x64-netcoreapp2.0.zip', + 'Windows_7_86': DOWNLOAD_URL_BASE + 'Microsoft.SqlTools.ServiceLayer-win-x86-netcoreapp2.0.zip' } CURRENT_DIRECTORY = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) @@ -78,6 +72,7 @@ def build_sqltoolsservice_wheels(platforms): os.environ[u'MSSQLTOOLSSERVICE_PLATFORM'] = platform print(u'Calling setup bdist_wheel for platform:{}'.format(platform)) + print(SUPPORTED_PLATFORMS[platform]) download_and_unzip(SUPPORTED_PLATFORMS[platform], directory=TARGET_DIRECTORY) utility.exec_command(u'python setup.py check -r -s bdist_wheel', CURRENT_DIRECTORY) diff --git a/mssqltoolsservice/mssqltoolsservice/__init__.py b/mssqltoolsservice/mssqltoolsservice/__init__.py index 659056a..53fb8bc 100644 --- a/mssqltoolsservice/mssqltoolsservice/__init__.py +++ b/mssqltoolsservice/mssqltoolsservice/__init__.py @@ -9,7 +9,7 @@ import os import platform -__version__ = '1.0.0a20' +__version__ = '1.0.0a21' def get_executable_path(): diff --git a/mssqltoolsservice/setup.py b/mssqltoolsservice/setup.py index bb0bd22..5a78e3a 100644 --- a/mssqltoolsservice/setup.py +++ b/mssqltoolsservice/setup.py @@ -12,7 +12,7 @@ # This version number is in place in two places and must be in sync with # mssqlscripter's version in setup.py. -MSSQLTOOLSSERVICE_VERSION = '1.0.0a20' +MSSQLTOOLSSERVICE_VERSION = '1.0.0a21' # If we have source, validate version numbers match to prevent # uploading releases with mismatched versions. diff --git a/setup.py b/setup.py index ffb2f01..8e98f02 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ # This version number is in place in two places and must be in sync with # mssqltoolsservice's version in setup.py. -MSSQLSCRIPTER_VERSION = '1.0.0a20' +MSSQLSCRIPTER_VERSION = '1.0.0a21' # If we have the source, validate our setup version matches source version. # This will prevent uploading releases with mismatched versions. This will @@ -58,119 +58,12 @@ MSSQLTOOLSSERVICE_PACKAGE_NAME = 'mssqltoolsservice-{}=={}' MSSQLTOOLSSERVICE_PACKAGE_SUFFIX = [ - 'CentOS_7', - 'Debian_8', - 'Fedora_23', - 'openSUSE_13_2', 'OSX_10_11_64', - 'RHEL_7', - 'Ubuntu_14', - 'Ubuntu_16', 'Windows_7_64', - 'Windows_7_86' + 'Windows_7_86', + 'Linux_64' ] -LINUX_DISTRO_NO_VERSION = { - 'centos': 'CentOS_7', - 'ol': 'CentOS_7', - 'fedora': 'Fedora_23', - 'opensuse': 'OpenSUSE_13_2', - 'rhel': 'RHEL_7', - 'debian': 'Debian_8', -} - -LINUX_DISTRO_WITH_VERSION = { - 'ubuntu': - { - '14': 'Ubuntu_14', - '16': 'Ubuntu_16' - }, - 'elementary': - { - '0.3': 'Ubuntu_14', - '0.4': 'Ubuntu_16' - }, - 'elementaryOS': - { - '0.3': 'Ubuntu_14', - '0.4': 'Ubuntu_16' - }, - 'linuxmint': - { - '18': 'Ubuntu_16' - }, - 'galliumos': - { - '2.0': 'Ubuntu_16' - }, -} - - -def _get_runtime_id_helper(name, version): - """ - Checks if linux distro name and version match to a supported package. - """ - if name in LINUX_DISTRO_NO_VERSION: - return LINUX_DISTRO_NO_VERSION[name] - - if name in LINUX_DISTRO_WITH_VERSION: - for supported_version in LINUX_DISTRO_WITH_VERSION[name]: - if version.startswith(supported_version): - return LINUX_DISTRO_WITH_VERSION[name][supported_version] - return None - - -def _get_linux_distro_runtime_id(content): - """ - Parse content for linux distro run time id. - """ - name = None - version = None - id_like = None - - # Try to find name, version and id_like best effort. - for line in content.splitlines(): - key, value = line.rstrip().split('=') - value = value.strip('"') - if key == 'ID': - name = value - elif key == 'VERSION_ID': - version = value - elif key == 'ID_LIKE': - id_like = value.split(' ') - if name and version and id_like: - break - # First try the distribution name. - run_time_id = _get_runtime_id_helper(name, version) - - # If we don't understand it, try the 'ID_LIKE' field. - if not run_time_id and id_like: - for name in id_like: - run_time_id = _get_runtime_id_helper(name, version) - if run_time_id: - break - - return run_time_id - - -def _get_linux_distro_from_file(): - """ - Find linux distro based on - https://www.freedesktop.org/software/systemd/man/os-release.html. - """ - os_release_info_file = None - - if os.path.exists('/etc/os-release'): - os_release_info_file = '/etc/os-release' - elif os.path.exists('/usr/lib/os-release'): - os_release_info_file = '/usr/lib/os-release' - else: - raise EnvironmentError('Error detecting Linux distro version.') - - with io.open(os_release_info_file, 'r', encoding='utf-8') as os_release_file: - content = os_release_file.read() - return _get_linux_distro_runtime_id(content) - def _get_runtime_id( system=_platform.system(), @@ -191,7 +84,7 @@ def _get_runtime_id( run_time_id = 'OSX_10_11_64' elif system == 'Linux': if architecture == '64bit': - run_time_id = _get_linux_distro_from_file() + run_time_id = 'Linux_64' return run_time_id