mirror of
https://github.com/apisnetworks/pyenv.git
synced 2026-11-30 19:59:01 +00:00
install-prerequisites: add an option for optional dependencies (#3560)
This commit is contained in:
1 parent
26370b7f24
commit
a3c666e177
2 files changed
+47
-14
No files matched your search
@@ -4,18 +4,21 @@ load test_helper
|
||||
|
||||
_setup() {
|
||||
prerequisites="make build-essential libssl-dev zlib1g-dev libbz2-dev \
|
||||
libreadline-dev libsqlite3-dev curl git llvm libncurses5-dev \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev \
|
||||
liblzma-dev libzstd-dev"
|
||||
libreadline-dev libsqlite3-dev curl git llvm libncurses5-dev \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev \
|
||||
liblzma-dev libzstd-dev"
|
||||
|
||||
optional="libgdbm-dev"
|
||||
}
|
||||
|
||||
@test "completion does not install packages" {
|
||||
@test "completions" {
|
||||
stub apt-get
|
||||
|
||||
PATH="${BATS_TEST_DIRNAME}/../../../libexec:$PATH" \
|
||||
run pyenv completions install-prerequisites
|
||||
run pyenv-install-prerequisites --complete
|
||||
|
||||
assert_success "--help"
|
||||
assert_success <<!
|
||||
--all
|
||||
!
|
||||
unstub apt-get
|
||||
}
|
||||
|
||||
@@ -28,7 +31,7 @@ liblzma-dev libzstd-dev"
|
||||
unstub pyenv-help
|
||||
}
|
||||
|
||||
@test "rejects arguments" {
|
||||
@test "invalid arguments" {
|
||||
stub pyenv-help 'install-prerequisites : echo "Usage: pyenv install-prerequisites"'
|
||||
|
||||
run pyenv-install-prerequisites unexpected
|
||||
@@ -50,6 +53,19 @@ liblzma-dev libzstd-dev"
|
||||
unstub id
|
||||
}
|
||||
|
||||
@test "installs optional prerequisites with --all" {
|
||||
stub id '-u : echo 0'
|
||||
stub apt-get \
|
||||
'update -q : true' \
|
||||
"install -yq ${prerequisites} ${optional} : true"
|
||||
|
||||
run pyenv-install-prerequisites --all
|
||||
|
||||
assert_success
|
||||
unstub apt-get
|
||||
unstub id
|
||||
}
|
||||
|
||||
@test "uses sudo when not running as root" {
|
||||
stub id '-u : echo 1000'
|
||||
stub apt-get
|
||||
|
||||
Reference in new issue
Block a user