datalad / datalad-installer

Installation script for Datalad and related components
MIT License
6 stars 3 forks source link

miniconda --batch still asked me confirmation #112

Closed yarikoptic closed 2 years ago

yarikoptic commented 2 years ago
(git)smaug:~datalad/datalad-master[master]
$> pip install --upgrade datalad-installer
WARNING: Keyring is skipped due to an exception: Failed to unlock the collection!
Collecting datalad-installer
  Downloading datalad_installer-0.8.2-py3-none-any.whl (25 kB)
Installing collected packages: datalad-installer
Successfully installed datalad-installer-0.8.2

$> datalad-installer -E /tmp/miniconda-test.sh miniconda --batch --spec python=3.7 --path /tmp/miniconda-test git-annex=8.20201007 -m conda
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Installing Miniconda
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Path: /tmp/miniconda-test
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Batch: True
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Spec: ['python=3.7']
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Extra args: None
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Downloading and running miniconda installer
2022-07-01T10:09:25-0400 [INFO    ] datalad_installer Downloading https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
2022-07-01T10:09:26-0400 [INFO    ] datalad_installer Installing miniconda in /tmp/miniconda-test
2022-07-01T10:09:26-0400 [INFO    ] datalad_installer Running: bash /home/yoh/.tmp/tmp54u9e7g0/Miniconda3-latest-Linux-x86_64.sh -p /tmp/miniconda-test -s -b
PREFIX=/tmp/miniconda-test
...
The following packages will be DOWNGRADED:

  brotlipy                          0.7.0-py39h27cfd23_1003 --> 0.7.0-py37h27cfd23_1003
  cffi                                1.15.0-py39hd667e15_1 --> 1.15.0-py37hd667e15_1
  conda-package-han~                   1.8.1-py39h7f8727e_0 --> 1.8.1-py37h7f8727e_0
  pip                                 21.2.4-py39h06a4308_0 --> 21.2.2-py37h06a4308_0
  pycosat                              0.6.3-py39h27cfd23_0 --> 0.6.3-py37h27cfd23_0
  python                                  3.9.12-h12debd9_0 --> 3.7.13-h12debd9_0
  ruamel_yaml                       0.15.100-py39h27cfd23_0 --> 0.15.100-py37h27cfd23_0
  setuptools                          61.2.0-py39h06a4308_0 --> 61.2.0-py37h06a4308_0

Proceed ([y]/n)? y

...

where I had to enter that y although with --batch I expect no interaction to be needed. Might be an issue with miniconda installer or conda itself, didn't check.

jwodder commented 2 years ago

@yarikoptic --batch corresponds to passing -b to the miniconda install script, and it only affects the behavior of that script, not of any Conda processes invoked by it.

yarikoptic commented 2 years ago

if we are requesting it to operate in --batch mode IMHO it should not ask questions and only then we would be true to our description of

  --batch                         Run in batch (noninteractive) mode

option. May be it is an issue then to bring up with the miniconda installer script people in that it should then invoke conda subprocesses with -y option. Or is there a dedicated -y in the installer script?

jwodder commented 2 years ago

@yarikoptic These are all the options of the install script:

-b           run install in batch mode (without manual intervention),
             it is expected the license terms are agreed upon
-f           no error if install prefix already exists
-h           print this help message and exit
-p PREFIX    install prefix, defaults to /Users/jwodder/miniconda3, must not contain spaces.
-s           skip running pre/post-link/install scripts
-u           update an existing installation
-t           run package tests after installation (may install conda-build)
yarikoptic commented 2 years ago

where is the spec we are passing? may be that one could just include -y ?

jwodder commented 2 years ago

@yarikoptic --spec is passed to conda install.

yarikoptic commented 2 years ago

then please pass -y to conda install if there --batch option we give to once again fulfill its promise.