@@ -428,7 +428,14 @@ function setup_lib {
428428# another project.
429429#
430430# use this for non namespaced libraries
431+ #
432+ # setup_dev_lib [-bindep] <name>
431433function setup_dev_lib {
434+ local bindep
435+ if [[ $1 == -b indep* ]]; then
436+ bindep=" ${1} "
437+ shift
438+ fi
432439 local name=$1
433440 local dir=${GITDIR[$name]}
434441 if python3_enabled; then
@@ -438,10 +445,10 @@ function setup_dev_lib {
438445 # of Python.
439446 echo " Installing $name again without Python 3 enabled"
440447 USE_PYTHON3=False
441- setup_develop $dir
448+ setup_develop $bindep $ dir
442449 USE_PYTHON3=True
443450 fi
444- setup_develop $dir
451+ setup_develop $bindep $ dir
445452}
446453
447454# this should be used if you want to install globally, all libraries should
@@ -452,11 +459,17 @@ function setup_dev_lib {
452459# extras: comma-separated list of optional dependencies to install
453460# (e.g., ldap,memcache).
454461# See https://docs.openstack.org/pbr/latest/user/using.html#extra-requirements
462+ # bindep: Set "-bindep" as first argument to install bindep.txt packages
455463# The command is like "pip install <project_dir>[<extras>]"
456464function setup_install {
465+ local bindep
466+ if [[ $1 == -b indep* ]]; then
467+ bindep=" ${1} "
468+ shift
469+ fi
457470 local project_dir=$1
458471 local extras=$2
459- _setup_package_with_constraints_edit $project_dir " " $extras
472+ _setup_package_with_constraints_edit $bindep $ project_dir " " $extras
460473}
461474
462475# this should be used for projects which run services, like all services
@@ -468,9 +481,14 @@ function setup_install {
468481# See https://docs.openstack.org/pbr/latest/user/using.html#extra-requirements
469482# The command is like "pip install -e <project_dir>[<extras>]"
470483function setup_develop {
484+ local bindep
485+ if [[ $1 == -b indep* ]]; then
486+ bindep=" ${1} "
487+ shift
488+ fi
471489 local project_dir=$1
472490 local extras=$2
473- _setup_package_with_constraints_edit $project_dir -e $extras
491+ _setup_package_with_constraints_edit $bindep $ project_dir -e $extras
474492}
475493
476494# ``pip install -e`` the package, which processes the dependencies
@@ -489,6 +507,11 @@ function setup_develop {
489507# See https://docs.openstack.org/pbr/latest/user/using.html#extra-requirements
490508# The command is like "pip install <flags> <project_dir>[<extras>]"
491509function _setup_package_with_constraints_edit {
510+ local bindep
511+ if [[ $1 == -b indep* ]]; then
512+ bindep=" ${1} "
513+ shift
514+ fi
492515 local project_dir=$1
493516 local flags=$2
494517 local extras=$3
@@ -509,7 +532,7 @@ function _setup_package_with_constraints_edit {
509532 " $flags file://$project_dir #egg=$name "
510533 fi
511534
512- setup_package $project_dir " $flags " $extras
535+ setup_package $bindep $ project_dir " $flags " $extras
513536
514537 # If this project is in LIBS_FROM_GIT, verify it was actually installed
515538 # correctly. This helps catch errors caused by constraints mismatches.
@@ -521,17 +544,30 @@ function _setup_package_with_constraints_edit {
521544}
522545
523546# ``pip install -e`` the package, which processes the dependencies
524- # using pip before running `setup.py develop`
547+ # using pip before running `setup.py develop`. The command is like
548+ # "pip install <flags> <project_dir>[<extras>]"
525549#
526550# Uses globals ``STACK_USER``
527- # setup_package project_dir [flags] [extras]
528- # project_dir: directory of project repo (e.g., /opt/stack/keystone)
529- # flags: pip CLI options/flags
530- # extras: comma-separated list of optional dependencies to install
531- # (e.g., ldap,memcache).
532- # See https://docs.openstack.org/pbr/latest/user/using.html#extra-requirements
533- # The command is like "pip install <flags> <project_dir>[<extras>]"
551+ #
552+ # Usage:
553+ # setup_package [-bindep[=profile,profile]] <project_dir> <flags> [extras]
554+ #
555+ # -bindep : Use bindep to install dependencies; select extra profiles
556+ # as comma separated arguments after "="
557+ # project_dir : directory of project repo (e.g., /opt/stack/keystone)
558+ # flags : pip CLI options/flags
559+ # extras : comma-separated list of optional dependencies to install
560+ # (e.g., ldap,memcache).
561+ # See https://docs.openstack.org/pbr/latest/user/using.html#extra-requirements
534562function setup_package {
563+ local bindep=0
564+ local bindep_flag=" "
565+ local bindep_profiles=" "
566+ if [[ $1 == -b indep* ]]; then
567+ bindep=1
568+ IFS=" =" read bindep_flag bindep_profiles <<< ${1}
569+ shift
570+ fi
535571 local project_dir=$1
536572 local flags=$2
537573 local extras=$3
@@ -547,6 +583,11 @@ function setup_package {
547583 extras=" [$extras ]"
548584 fi
549585
586+ # install any bindep packages
587+ if [[ $bindep == 1 ]]; then
588+ install_bindep $project_dir /bindep.txt $bindep_profiles
589+ fi
590+
550591 pip_install $flags " $project_dir$extras "
551592 # ensure that further actions can do things like setup.py sdist
552593 if [[ " $flags " == " -e" ]]; then
0 commit comments