Skip to content

Commit a43e717

Browse files
committed
add wheel scripts
1 parent 89d9e12 commit a43e717

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ bld/
2929
[Bb]in/
3030
[Oo]bj/
3131
[Ll]og/
32+
out/
3233

3334
# Visual Studio 2015 cache/options directory
3435
.vs/

scripts/create_wheels.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 bdist_wheel --universal', os.path.dirname(file))

scripts/windows/create_wheels.cmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@REM init section. Set _echo=1 to echo everything
2+
@IF NOT DEFINED _echo ECHO OFF
3+
4+
pip install wheel --upgrade --no-cache-dir
5+
6+
python.exe %~dp0\..\create_wheels.py
7+
IF ERRORLEVEL 1 GOTO FAIL
8+
9+
GOTO :EOF
10+
11+
:FAIL
12+
ECHO Failed to create wheels.
13+
EXIT /B 1

0 commit comments

Comments
 (0)