Add Mac and Windows implementations of CIBW_SKIP
This commit is contained in:
+10
-6
@@ -10,13 +10,13 @@ except ImportError:
|
|||||||
from .util import prepare_command
|
from .util import prepare_command
|
||||||
|
|
||||||
|
|
||||||
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build):
|
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
|
||||||
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'url'])
|
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'identifier', 'url'])
|
||||||
python_configurations = [
|
python_configurations = [
|
||||||
PythonConfiguration(version='2.7', url='https://www.python.org/ftp/python/2.7.13/python-2.7.13-macosx10.6.pkg'),
|
PythonConfiguration(version='2.7', identifier='cp27-macosx_10_6_intel', url='https://www.python.org/ftp/python/2.7.13/python-2.7.13-macosx10.6.pkg'),
|
||||||
PythonConfiguration(version='3.4', url='https://www.python.org/ftp/python/3.4.4/python-3.4.4-macosx10.6.pkg'),
|
PythonConfiguration(version='3.4', identifier='cp34-macosx_10_6_intel', url='https://www.python.org/ftp/python/3.4.4/python-3.4.4-macosx10.6.pkg'),
|
||||||
PythonConfiguration(version='3.5', url='https://www.python.org/ftp/python/3.5.3/python-3.5.3-macosx10.6.pkg'),
|
PythonConfiguration(version='3.5', identifier='cp35-macosx_10_6_intel', url='https://www.python.org/ftp/python/3.5.3/python-3.5.3-macosx10.6.pkg'),
|
||||||
PythonConfiguration(version='3.6', url='https://www.python.org/ftp/python/3.6.0/python-3.6.0-macosx10.6.pkg'),
|
PythonConfiguration(version='3.6', identifier='cp36-macosx_10_6_intel', url='https://www.python.org/ftp/python/3.6.0/python-3.6.0-macosx10.6.pkg'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def shell(args, env=None, cwd=None):
|
def shell(args, env=None, cwd=None):
|
||||||
@@ -25,6 +25,10 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
|
|||||||
return subprocess.check_call(args, env=env, cwd=cwd)
|
return subprocess.check_call(args, env=env, cwd=cwd)
|
||||||
|
|
||||||
for config in python_configurations:
|
for config in python_configurations:
|
||||||
|
if skip(config.identifier):
|
||||||
|
print('cibuildwheel: Skipping build %s' % config.identifier, file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
# download the pkg
|
# download the pkg
|
||||||
shell(['curl', '-L', '-o', '/tmp/Python.pkg', config.url])
|
shell(['curl', '-L', '-o', '/tmp/Python.pkg', config.url])
|
||||||
# install
|
# install
|
||||||
|
|||||||
+16
-12
@@ -5,7 +5,7 @@ from collections import namedtuple
|
|||||||
from .util import prepare_command
|
from .util import prepare_command
|
||||||
|
|
||||||
|
|
||||||
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build):
|
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
|
||||||
# run_with_env is a cmd file that sets the right environment variables to
|
# run_with_env is a cmd file that sets the right environment variables to
|
||||||
run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd')
|
run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd')
|
||||||
if not os.path.exists(run_with_env):
|
if not os.path.exists(run_with_env):
|
||||||
@@ -19,21 +19,25 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
|
|||||||
args = ['cmd', '/E:ON', '/V:ON', '/C', run_with_env] + args
|
args = ['cmd', '/E:ON', '/V:ON', '/C', run_with_env] + args
|
||||||
return subprocess.check_call(' '.join(args), env=env, cwd=cwd)
|
return subprocess.check_call(' '.join(args), env=env, cwd=cwd)
|
||||||
|
|
||||||
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'arch', 'path'])
|
PythonConfiguration = namedtuple('PythonConfiguration', ['version', 'arch', 'identifier', 'path'])
|
||||||
python_configurations = [
|
python_configurations = [
|
||||||
PythonConfiguration(version='2.7.x', arch="32", path='C:\Python27'),
|
PythonConfiguration(version='2.7.x', arch="32", identifier='cp27-win32', path='C:\Python27'),
|
||||||
PythonConfiguration(version='2.7.x', arch="64", path='C:\Python27-x64'),
|
PythonConfiguration(version='2.7.x', arch="64", identifier='cp27-win_amd64', path='C:\Python27-x64'),
|
||||||
PythonConfiguration(version='3.3.x', arch="32", path='C:\Python33'),
|
PythonConfiguration(version='3.3.x', arch="32", identifier='cp33-win32', path='C:\Python33'),
|
||||||
PythonConfiguration(version='3.3.x', arch="64", path='C:\Python33-x64'),
|
PythonConfiguration(version='3.3.x', arch="64", identifier='cp33-win_amd64', path='C:\Python33-x64'),
|
||||||
PythonConfiguration(version='3.4.x', arch="32", path='C:\Python34'),
|
PythonConfiguration(version='3.4.x', arch="32", identifier='cp34-win32', path='C:\Python34'),
|
||||||
PythonConfiguration(version='3.4.x', arch="64", path='C:\Python34-x64'),
|
PythonConfiguration(version='3.4.x', arch="64", identifier='cp34-win_amd64', path='C:\Python34-x64'),
|
||||||
PythonConfiguration(version='3.5.x', arch="32", path='C:\Python35'),
|
PythonConfiguration(version='3.5.x', arch="32", identifier='cp35-win32', path='C:\Python35'),
|
||||||
PythonConfiguration(version='3.5.x', arch="64", path='C:\Python35-x64'),
|
PythonConfiguration(version='3.5.x', arch="64", identifier='cp35-win_amd64', path='C:\Python35-x64'),
|
||||||
PythonConfiguration(version='3.6.x', arch="32", path='C:\Python36'),
|
PythonConfiguration(version='3.6.x', arch="32", identifier='cp36-win32', path='C:\Python36'),
|
||||||
PythonConfiguration(version='3.6.x', arch="64", path='C:\Python36-x64'),
|
PythonConfiguration(version='3.6.x', arch="64", identifier='cp36-win_amd64', path='C:\Python36-x64'),
|
||||||
]
|
]
|
||||||
|
|
||||||
for config in python_configurations:
|
for config in python_configurations:
|
||||||
|
if skip(config.identifier):
|
||||||
|
print('cibuildwheel: Skipping build %s' % config.identifier, file=sys.stderr)
|
||||||
|
continue
|
||||||
|
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
# set up environment variables for run_with_env
|
# set up environment variables for run_with_env
|
||||||
env['PYTHON_VERSION'] = config.version
|
env['PYTHON_VERSION'] = config.version
|
||||||
|
|||||||
Reference in New Issue
Block a user