Skip to content

Commit

Permalink
Merge pull request #2 from Microsoft/users/tedchamb/initial
Browse files Browse the repository at this point in the history
add sdist
  • Loading branch information
tedchamb authored Oct 21, 2017
2 parents b3c4111 + 37fda02 commit f9677c0
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/dev_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from subprocess import check_call, CalledProcessError

root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))

os.chdir(root_dir)

def exec_command(command):
try:
Expand Down
31 changes: 31 additions & 0 deletions scripts/sdist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from __future__ import print_function

import sys
import glob
import os
from subprocess import check_call, CalledProcessError

root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))
os.chdir(root_dir)

def exec_command(command, cwd):
try:
print('CWD: ' + cwd)
print('Executing: ' + command)
check_call(command.split(), cwd=cwd)
print()
except CalledProcessError as err:
print(err, file=sys.stderr)
sys.exit(1)

setup_files = glob.glob('src/*/setup.py')
setup_files.extend(glob.glob('src/*/*/setup.py'))

# sdist packages
for file in setup_files:
exec_command('python setup.py sdist', os.path.dirname(file))
1 change: 0 additions & 1 deletion scripts/windows/dev_setup.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@REM -------------------------------------------------
@REM init section. Set _echo=1 to echo everything
@IF NOT DEFINED _echo ECHO OFF

Expand Down
1 change: 0 additions & 1 deletion scripts/windows/init.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@REM -------------------------------------------------
@REM init section. Set _echo=1 to echo everything
@IF NOT DEFINED _echo ECHO OFF

Expand Down
20 changes: 20 additions & 0 deletions scripts/windows/sdist.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@REM init section. Set _echo=1 to echo everything
@IF NOT DEFINED _echo ECHO OFF

IF EXIST "%BUILD_BINARIESDIRECTORY%\python.3.6.2\tools\python.exe" (
REM Build step installs Python here.
SET PYTHONEXE=%BUILD_BINARIESDIRECTORY%\python.3.6.2\tools\python.exe
) ELSE (
SET PYTHONEXE=python.exe
)

"%PYTHONEXE%" %~dp0\..\sdist.py
IF ERRORLEVEL 1 GOTO FAIL

SET PYTHONEXE=

GOTO :EOF

:FAIL
ECHO sdist failed.
EXIT /B 1
1 change: 0 additions & 1 deletion src/vsts-cli/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[bdist_wheel]
universal=1

0 comments on commit f9677c0

Please sign in to comment.