Merge pull request #204 from mayeut/appveyor-linux
Rework platform detection to ignore CI provider to determine windows/linux/macos. A check is still present to check if CI is running or not.
This commit is contained in:
+3
-3
@@ -23,11 +23,11 @@ matrix:
|
|||||||
- os: windows
|
- os: windows
|
||||||
language: shell
|
language: shell
|
||||||
before_install:
|
before_install:
|
||||||
- choco install python3 --version 3.6.8 --no-progress -y
|
- choco install python3 --version 3.5.4 --no-progress -y
|
||||||
install:
|
install:
|
||||||
- C:\\Python36\\python -m pip install -r requirements-dev.txt
|
- C:\\Python35\\python -m pip install -r requirements-dev.txt
|
||||||
script:
|
script:
|
||||||
- C:\\Python36\\python ./bin/run_tests.py
|
- C:\\Python35\\python ./bin/run_tests.py
|
||||||
|
|
||||||
install: $PYTHON -m pip install -r requirements-dev.txt
|
install: $PYTHON -m pip install -r requirements-dev.txt
|
||||||
|
|
||||||
|
|||||||
+8
-7
@@ -1,10 +1,11 @@
|
|||||||
environment:
|
image:
|
||||||
matrix:
|
- Ubuntu
|
||||||
- PYTHON: "C:\\Python27\\python.exe"
|
- Visual Studio 2015
|
||||||
- PYTHON: "C:\\Python35\\python.exe"
|
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- "%PYTHON% -m pip install -r requirements-dev.txt"
|
- cmd: "C:\\Python27\\python.exe -m pip install -r requirements-dev.txt"
|
||||||
# the '-u' flag is required so the output is in the correct order.
|
- sh: "${HOME}/.localpython3.7.4/bin/python3 -m pip install -r requirements-dev.txt"
|
||||||
|
# the '-u' flag is required so the output is in the correct order.
|
||||||
# See https://github.com/joerick/cibuildwheel/pull/24 for more info.
|
# See https://github.com/joerick/cibuildwheel/pull/24 for more info.
|
||||||
- "%PYTHON% -u ./bin/run_tests.py"
|
- cmd: "C:\\Python27\\python.exe -u ./bin/run_tests.py"
|
||||||
|
- sh: "${HOME}/.localpython3.7.4/bin/python3 ./bin/run_tests.py"
|
||||||
|
|||||||
+14
-25
@@ -24,6 +24,12 @@ def get_option_from_environment(option_name, platform=None, default=None):
|
|||||||
return os.environ.get(option_name, default)
|
return os.environ.get(option_name, default)
|
||||||
|
|
||||||
|
|
||||||
|
def strtobool(val):
|
||||||
|
if val.lower() in ('y', 'yes', 't', 'true', 'on', '1'):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description='Build wheels for all the platforms.',
|
description='Build wheels for all the platforms.',
|
||||||
@@ -38,7 +44,7 @@ def main():
|
|||||||
'script is going to automatically install MacPython on your system, '
|
'script is going to automatically install MacPython on your system, '
|
||||||
'so don\'t run on your development machine. For "windows", you need to '
|
'so don\'t run on your development machine. For "windows", you need to '
|
||||||
'run in Windows, and it will build and test for all versions of '
|
'run in Windows, and it will build and test for all versions of '
|
||||||
'Python at C:\\PythonXX[-x64]. Default: auto.'))
|
'Python. Default: auto.'))
|
||||||
parser.add_argument('--output-dir',
|
parser.add_argument('--output-dir',
|
||||||
default=os.environ.get('CIBW_OUTPUT_DIR', 'wheelhouse'),
|
default=os.environ.get('CIBW_OUTPUT_DIR', 'wheelhouse'),
|
||||||
help='Destination folder for the wheels.')
|
help='Destination folder for the wheels.')
|
||||||
@@ -59,36 +65,19 @@ def main():
|
|||||||
if args.platform != 'auto':
|
if args.platform != 'auto':
|
||||||
platform = args.platform
|
platform = args.platform
|
||||||
else:
|
else:
|
||||||
platform = None
|
ci = strtobool(os.environ.get('CI', 'false')) or 'BITRISE_BUILD_NUMBER' in os.environ or 'AZURE_HTTP_USER_AGENT' in os.environ
|
||||||
|
if ci:
|
||||||
if os.environ.get('TRAVIS_OS_NAME') == 'linux':
|
|
||||||
platform = 'linux'
|
|
||||||
elif os.environ.get('TRAVIS_OS_NAME') == 'osx':
|
|
||||||
platform = 'macos'
|
|
||||||
elif os.environ.get('TRAVIS_OS_NAME') == 'windows':
|
|
||||||
platform = 'windows'
|
|
||||||
elif 'APPVEYOR' in os.environ:
|
|
||||||
platform = 'windows'
|
|
||||||
elif 'BITRISE_BUILD_NUMBER' in os.environ:
|
|
||||||
platform = 'macos'
|
|
||||||
elif os.environ.get('CIRCLECI'):
|
|
||||||
if sys.platform.startswith('linux'):
|
if sys.platform.startswith('linux'):
|
||||||
platform = 'linux'
|
platform = 'linux'
|
||||||
elif sys.platform.startswith('darwin'):
|
elif sys.platform == 'darwin':
|
||||||
platform = 'macos'
|
platform = 'macos'
|
||||||
elif 'AZURE_HTTP_USER_AGENT' in os.environ:
|
elif sys.platform == 'win32':
|
||||||
if os.environ['AGENT_OS'] == 'Linux':
|
|
||||||
platform = 'linux'
|
|
||||||
elif os.environ['AGENT_OS'] == 'Darwin':
|
|
||||||
platform = 'macos'
|
|
||||||
elif os.environ['AGENT_OS'] == 'Windows_NT':
|
|
||||||
platform = 'windows'
|
platform = 'windows'
|
||||||
|
|
||||||
if platform is None:
|
if platform is None:
|
||||||
print('cibuildwheel: Unable to detect platform. cibuildwheel should run on your CI server, '
|
print('cibuildwheel: Unable to detect platform. cibuildwheel should run on your CI server, '
|
||||||
'Travis CI, AppVeyor, and CircleCI are supported. You can run on your development '
|
'Travis CI, AppVeyor, Azure Pipelines and CircleCI are supported. You can run on your '
|
||||||
'machine using the --platform argument. Check --help output for more '
|
'development machine or other CI providers using the --platform argument. Check --help '
|
||||||
'information.',
|
'output for more information.',
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user