add create wheels script and draft of packaging for windows

This commit is contained in:
Ted Chambers 2017-10-24 15:51:03 -04:00
Родитель 0bcf36cbf1
Коммит 39a3d449ca
3 изменённых файлов: 51 добавлений и 4 удалений

9
.gitignore поставляемый
Просмотреть файл

@ -18,6 +18,10 @@ env/**
dist/
lib/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@ -29,6 +33,7 @@ bld/
[Bb]in/
[Oo]bj/
[Ll]og/
out/
# Visual Studio 2015 cache/options directory
.vs/
@ -276,10 +281,6 @@ paket-files/
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config

33
scripts/create_wheels.py Normal file
Просмотреть файл

@ -0,0 +1,33 @@
# --------------------------------------------------------------------------------------------
# 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 = [setup_file for root, dirs, files in os.walk(root_dir)
for setup_file in glob.glob(os.path.join(root, 'setup.py'))]
# sdist packages
for file in setup_files:
exec_command('python setup.py bdist_wheel --universal', os.path.dirname(file))

Просмотреть файл

@ -0,0 +1,13 @@
@REM init section. Set _echo=1 to echo everything
@IF NOT DEFINED _echo ECHO OFF
pip install wheel --upgrade --no-cache-dir
python.exe %~dp0\..\create_wheels.py
IF ERRORLEVEL 1 GOTO FAIL
GOTO :EOF
:FAIL
ECHO Failed to create wheels.
EXIT /B 1