Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Ron/sqltoolsservice update #163

Merged
merged 5 commits into from
Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def build(platform_names):

# clean
utility.clean_up(utility.MSSQLSCRIPTER_DIST_DIRECTORY)
utility.cleaun_up_egg_info_sub_directories(utility.ROOT_DIR)

print_heading('Running setup')

Expand All @@ -40,12 +39,15 @@ def build(platform_names):
utility.exec_command('python dos2unix.py mssql-scripter mssql-scripter', utility.ROOT_DIR)

for platform in platform_names:
utility.clean_up(utility.MSSQLSCRIPTER_BUILD_DIRECTORY)
utility.cleaun_up_egg_info_sub_directories(utility.ROOT_DIR)

mssqltoolsservice.copy_sqltoolsservice(platform)

print_heading('Building mssql-scripter {} wheel package package'.format(platform))
utility.exec_command('python --version', utility.ROOT_DIR)
utility.exec_command(
'python setup.py check -r -s bdist_wheel --plat-name {}'.format(platform),
'python setup.py check -r -s bdist_wheel --plat-name {}'.format(platform),
utility.ROOT_DIR,
continue_on_error=False)

Expand Down
Empty file modified mssql-scripter
100644 → 100755
Empty file.
28 changes: 15 additions & 13 deletions mssqlscripter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,21 @@ def main(args):
sys.stdout.write(line)

finally:

sql_tools_client.shutdown()
tools_service_process.kill()
# 1 second time out, allow tools service process to be killed.
time.sleep(.1)
# Close the stdout file handle or else we would get a resource warning (found via pytest).
# This must be closed after the process is killed, otherwise we would block because the process is using
# it's stdout.
tools_service_process.stdout.close()
# None value indicates process has not terminated.
if not tools_service_process.poll():
sys.stderr.write(
u'Sql Tools Service process was not shut down properly.')
if sql_tools_client:
sql_tools_client.shutdown()

if tools_service_process:
tools_service_process.kill()
# 1 second time out, allow tools service process to be killed.
time.sleep(.1)
# Close the stdout file handle or else we would get a resource warning (found via pytest).
# This must be closed after the process is killed, otherwise we would block because the process is using
# it's stdout.
tools_service_process.stdout.close()
# None value indicates process has not terminated.
if not tools_service_process.poll():
sys.stderr.write(
u'Sql Tools Service process was not shut down properly.')
try:
# Remove the temp file if we generated one.
if temp_file_path:
Expand Down
1 change: 1 addition & 0 deletions mssqlscripter/mssqltoolsservice/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def copy_sqltoolsservice(platform):
utility.clean_up(directory=TARGET_DIRECTORY)

if not platform or platform not in SUPPORTED_PLATFORMS:
print('{} is not supported.'.format(platform))
print('Please provide a valid platform flag.' +
'[win32, win_amd64, win64, manylinux1_x86_64, manylinux1_i686, macosx_10_11_intel]')
sys.exit(1)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
MSSQLSCRIPTER_DIST_DIRECTORY = os.path.abspath(
os.path.join(os.path.abspath(__file__), '..', 'dist'))

MSSQLSCRIPTER_BUILD_DIRECTORY = os.path.abspath(
os.path.join(os.path.abspath(__file__), '..', 'build'))


def exec_command(command, directory, continue_on_error=True):
"""
Expand Down