Skip to content

Commit 8353826

Browse files
committed
fix up PS init script
1 parent ba0dc4b commit 8353826

6 files changed

Lines changed: 61 additions & 3 deletions

File tree

scripts/dev_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def exec_command(command):
2222
print(err, file=sys.stderr)
2323
sys.exit(1)
2424

25+
2526
packages = [os.path.dirname(p) for p in glob.glob('vsts*/setup.py')]
2627

2728
# Extract nspkg and sort nspkg by number of "-"

scripts/sdist.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------
5+
6+
from __future__ import print_function
7+
8+
import sys
9+
import glob
10+
import os
11+
from subprocess import check_call, CalledProcessError
12+
13+
root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..'))
14+
os.chdir(root_dir)
15+
16+
17+
def exec_command(command, cwd):
18+
try:
19+
print('CWD: ' + cwd)
20+
print('Executing: ' + command)
21+
check_call(command.split(), cwd=cwd)
22+
print()
23+
except CalledProcessError as err:
24+
print(err, file=sys.stderr)
25+
sys.exit(1)
26+
27+
28+
setup_files = [setup_file for root, dirs, files in os.walk(root_dir)
29+
for setup_file in glob.glob(os.path.join(root, 'setup.py'))]
30+
31+
# sdist packages
32+
for file in setup_files:
33+
exec_command('python setup.py sdist', os.path.dirname(file))

scripts/windows/sdist.cmd

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
@REM init section. Set _echo=1 to echo everything
2+
@IF NOT DEFINED _echo ECHO OFF
3+
4+
IF EXIST "%BUILD_BINARIESDIRECTORY%\python.3.6.2\tools\python.exe" (
5+
REM Build step installs Python here.
6+
SET PYTHONEXE=%BUILD_BINARIESDIRECTORY%\python.3.6.2\tools\python.exe
7+
) ELSE (
8+
SET PYTHONEXE=python.exe
9+
)
10+
11+
"%PYTHONEXE%" %~dp0\..\sdist.py
12+
IF ERRORLEVEL 1 GOTO FAIL
13+
14+
SET PYTHONEXE=
15+
16+
GOTO :EOF
17+
18+
:FAIL
19+
ECHO sdist failed.
20+
EXIT /B 1

vsts/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from setuptools import setup, find_packages
77

88
NAME = "vsts"
9-
VERSION = "0.1.0-preview+dev"
9+
VERSION = "0.1.0-beta+dev"
1010

1111
# To install the library, run the following
1212
#

vsts/vsts/git/v4_1/models/git_repository_ref.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class GitRepositoryRef(Model):
1616
:type collection: :class:`TeamProjectCollectionReference <git.models.TeamProjectCollectionReference>`
1717
:param id:
1818
:type id: str
19+
:param is_fork: True if the repository was created as a fork
20+
:type is_fork: bool
1921
:param name:
2022
:type name: str
2123
:param project:
@@ -31,17 +33,19 @@ class GitRepositoryRef(Model):
3133
_attribute_map = {
3234
'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'},
3335
'id': {'key': 'id', 'type': 'str'},
36+
'is_fork': {'key': 'isFork', 'type': 'bool'},
3437
'name': {'key': 'name', 'type': 'str'},
3538
'project': {'key': 'project', 'type': 'TeamProjectReference'},
3639
'remote_url': {'key': 'remoteUrl', 'type': 'str'},
3740
'ssh_url': {'key': 'sshUrl', 'type': 'str'},
3841
'url': {'key': 'url', 'type': 'str'}
3942
}
4043

41-
def __init__(self, collection=None, id=None, name=None, project=None, remote_url=None, ssh_url=None, url=None):
44+
def __init__(self, collection=None, id=None, is_fork=None, name=None, project=None, remote_url=None, ssh_url=None, url=None):
4245
super(GitRepositoryRef, self).__init__()
4346
self.collection = collection
4447
self.id = id
48+
self.is_fork = is_fork
4549
self.name = name
4650
self.project = project
4751
self.remote_url = remote_url

vsts/vsts/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
VERSION = "0.1.0-preview+dev"
6+
VERSION = "0.1.0-beta+dev"

0 commit comments

Comments
 (0)