Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
tox.ini: Simplify, use sage-get-system-packages, sage-package list
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Nov 24, 2020
1 parent 85f8ce5 commit 0e97683
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ setenv =
local: SETENV=:
local-nobootstrap: BOOTSTRAP=:
local-!direct: PATH=/usr/bin:/bin:/usr/sbin:/sbin
local-sudo: __SUDO=--sudo
# brew caches downloaded files in ${HOME}/Library/Caches. We share it between different toxenvs.
local-homebrew: HOMEBREW={envdir}/homebrew
local-homebrew-usrlocal: HOMEBREW=/usr/local
Expand Down Expand Up @@ -387,12 +388,7 @@ commands =
#
# https://docs.brew.sh/Installation
homebrew: bash -c 'if [ ! -x {env:HOMEBREW}/bin/brew ]; then mkdir -p {env:HOMEBREW} && cd {env:HOMEBREW} && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 ; fi'
# homebrew-minimal: Minimal for bootstrapping and build.
# gettext and pkg-config are needed so that their aclocal macros are available.
homebrew: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/homebrew*.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
homebrew-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
homebrew-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/homebrew.txt`; {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
homebrew: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages homebrew $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS})); {env:HOMEBREW}/bin/brew install $PACKAGES; {env:HOMEBREW}/bin/brew upgrade $PACKAGES'
#
# local-conda
#
Expand All @@ -405,18 +401,12 @@ commands =
local-conda: bash -c 'cat {env:CONDARC} >> {env:CONDA_PREFIX}/.condarc'
local-conda: bash -c 'if [ ! -x {env:CONDA_PREFIX}/bin/conda ]; then curl -L {env:CONDA_INSTALLER_URL_BASE}{env:CONDA_INSTALLER_FILE} -C - -o {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} && bash {env:SHARED_CACHE_DIR}/{env:CONDA_INSTALLER_FILE} -b -f -p {env:CONDA_PREFIX}; fi'
local-conda: bash -c '{env:SETENV} && {env:CONDA_PREFIX}/bin/conda update -n base --yes conda'
local-conda: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/conda*.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
local-conda-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
local-conda-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/conda.txt`; {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
local-conda: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages conda $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS})); {env:SETENV} && {env:CONDA_PREFIX}/bin/conda install --yes --quiet $PACKAGES'
#
# local-sudo
# local-sudo: Use sudo to run the system package commands as root
#
local-sudo: bash -c '$(build/bin/sage-print-system-package-command {env:SYSTEM} update) #'
local-sudo: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/{env:SYSTEM}*.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
# -standard and -maximal are for now the same. This should be fixed when refactoring write-dockerfile.
local-sudo-standard: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
local-sudo-maximal: bash -c 'PACKAGES=`sed "s/#.*//;" build/pkgs/*/distros/{env:SYSTEM}.txt`; $(build/bin/sage-print-system-package-command {env:SYSTEM} --sudo --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
local-sudo: bash -c 'PACKAGES=$(build/bin/sage-get-system-packages {env:SYSTEM} $(PATH=build/bin:$PATH build/bin/sage-package list {env:SAGE_PACKAGE_LIST_ARGS})); $(build/bin/sage-print-system-package-command {env:SYSTEM} {env:__SUDO:} --yes --no-install-recommends install $PACKAGES) || [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" '
#
# All "local" environments
#
Expand Down

0 comments on commit 0e97683

Please sign in to comment.