Skip to content

Commit

Permalink
Renaming util.get_build_verbosity_flag into util.get_build_verbosity_…
Browse files Browse the repository at this point in the history
…extra_flags
  • Loading branch information
YannickJadoul committed Apr 30, 2018
1 parent 8d9d970 commit eedcd62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cibuildwheel/linux.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import print_function
import os, subprocess, sys
from collections import namedtuple
from .util import prepare_command, get_build_verbosity_flag
from .util import prepare_command, get_build_verbosity_extra_flags

try:
from shlex import quote as shlex_quote
Expand Down Expand Up @@ -108,7 +108,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
before_build=shlex_quote(
prepare_command(before_build, python='python', pip='pip', project='/project') if before_build else ''
),
build_verbosity_flag=get_build_verbosity_flag(build_verbosity),
build_verbosity_flag=' '.join(get_build_verbosity_extra_flags(build_verbosity)),
environment_exports='\n'.join(environment.as_shell_commands()),
)

Expand Down
5 changes: 2 additions & 3 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
except ImportError:
from pipes import quote as shlex_quote

from .util import prepare_command, get_build_verbosity_flag
from .util import prepare_command, get_build_verbosity_extra_flags


def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, build_verbosity, skip, environment):
Expand Down Expand Up @@ -87,8 +87,7 @@ def call(args, env=None, cwd=None, shell=False):
call(before_build_prepared, env=env, shell=True)

# build the wheel
build_verbosity_flag = get_build_verbosity_flag(build_verbosity)
call([pip, 'wheel', abs_project_dir, '-w', '/tmp/built_wheel', '--no-deps'] + ([build_verbosity_flag] if build_verbosity_flag else []), env=env)
call([pip, 'wheel', abs_project_dir, '-w', '/tmp/built_wheel', '--no-deps'] + get_build_verbosity_extra_flags(build_verbosity), env=env)
built_wheel = glob('/tmp/built_wheel/*.whl')[0]

if built_wheel.endswith('none-any.whl'):
Expand Down
8 changes: 4 additions & 4 deletions cibuildwheel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ def prepare_command(command, python, pip, project):
return command.format(python=python, pip=pip, project=project)


def get_build_verbosity_flag(level):
def get_build_verbosity_extra_flags(level):
if level > 0:
return '-' + level * 'v'
return ['-' + level * 'v']
elif level < 0:
return '-' + -level * 'q'
return ['-' + -level * 'q']
else:
return ''
return []


class BuildSkipper(object):
Expand Down
5 changes: 2 additions & 3 deletions cibuildwheel/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from collections import namedtuple
from glob import glob

from .util import prepare_command, get_build_verbosity_flag, Unbuffered
from .util import prepare_command, get_build_verbosity_extra_flags, Unbuffered


def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, build_verbosity, skip, environment):
Expand Down Expand Up @@ -82,8 +82,7 @@ def shell(args, env=None, cwd=None):
shell([before_build_prepared], env=env)

# build the wheel
build_verbosity_flag = get_build_verbosity_flag(build_verbosity)
shell(['pip', 'wheel', abs_project_dir, '-w', built_wheel_dir, '--no-deps'] + ([build_verbosity_flag] if build_verbosity_flag else []), env=env)
shell(['pip', 'wheel', abs_project_dir, '-w', built_wheel_dir, '--no-deps'] + get_build_verbosity_extra_flags(build_verbosity), env=env)
built_wheel = glob(built_wheel_dir+'/*.whl')[0]

# install the wheel
Expand Down

0 comments on commit eedcd62

Please sign in to comment.