galaxyproject / galaxy

Data intensive science for everyone.
https://galaxyproject.org
Other
1.38k stars 992 forks source link

Installation of command line utils for mulled containers #15636

Open fabianegli opened 1 year ago

fabianegli commented 1 year ago

Describe the bug When installing galaxy-tool-util with pip the command line tools are not installed. Trying to use e.g. mulled_search then warns that Whoosh is missing and sugest installation with pip but this fails because it also depends on conda and conda can't be installed with pip.

python -m galaxy.tool_util.deps.mulled.mulled_search scipy                                          
Required dependency [Whoosh] is not installed. Run 'pip install galaxy-tool-util[mulled]'.
user@fee-mbp tst % pip install galaxy-tool-util[mulled]                                                     
zsh: no matches found: galaxy-tool-util[mulled]
(venv) user@fee-mbp tst % pip install galaxy-tool-util\[mulled\]
... 
Collecting conda
  Downloading conda-4.3.16.tar.gz (299 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 299.3/299.3 kB 29.6 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]

      WARNING: Your current install method for conda only supports conda
      as a python library.  You are not installing a conda executable command
      or activate/deactivate commands.  If your intention is to install conda
      as a standalone application, currently supported install methods include
      the Anaconda installer and the miniconda installer.  If you'd still like
      for setup.py to create entry points for you, use `utils/setup-testing.py`.

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-17diexkj/conda_e6b274e14fa94c72a214c4afedc3d99c/setup.py", line 35, in <module>
          import conda._vendor.auxlib.packaging  # NOQA
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-17diexkj/conda_e6b274e14fa94c72a214c4afedc3d99c/conda/__init__.py", line 13, in <module>
          from .common.compat import iteritems, text_type
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-17diexkj/conda_e6b274e14fa94c72a214c4afedc3d99c/conda/common/compat.py", line 77, in <module>
          from collections import Iterable
      ImportError: cannot import name 'Iterable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Galaxy Version and/or server at which you observed the bug galaxy-tool-util-22.1.5

To Reproduce Steps to reproduce the behavior:

python3.10 -m venv venv
. venv/bin/activate 
pip install galaxy-tool-util
python -m galaxy.tool_util.deps.mulled.mulled_search scipy
pip install galaxy-tool-util[mulled]   # or in zsh: pip install galaxy-tool-util\[mulled\]

Expected behavior Expected to have the commands in https://github.com/galaxyproject/galaxy/blob/ff14fc11283c8eb88a42120b1bc976bbb87beb61/packages/tool_util/setup.cfg#L48 installed and available. Also that the above mentioned call to mulled_search works.

mvdbeek commented 1 year ago

pip install --pre 'galaxy-tool-util[mulled]' that's fixed in the code, we'll have to cut a new release of the packages. Can you give that a try and see if it works for you ?

fabianegli commented 1 year ago

That's not the issue. The problem is conda doesn't want to be installed with pip.

fabianegli commented 1 year ago

But here you go:

% pip install --pre 'galaxy-tool-util[mulled]'
Requirement already satisfied: galaxy-tool-util[mulled] in ./venv/lib/python3.10/site-packages (22.1.5)
Requirement already satisfied: sortedcontainers in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (2.4.0)
Requirement already satisfied: galaxy-containers>=22.1 in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (22.1.1)
Requirement already satisfied: typing-extensions in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (4.5.0)
Requirement already satisfied: pydantic in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (1.10.5)
Requirement already satisfied: galaxy-util>=22.1 in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (22.1.2)
Requirement already satisfied: pyyaml in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (6.0)
Requirement already satisfied: lxml in ./venv/lib/python3.10/site-packages (from galaxy-tool-util[mulled]) (4.9.2)
Collecting cytoolz
  Using cached cytoolz-0.12.1-cp310-cp310-macosx_10_9_x86_64.whl (409 kB)
Collecting jinja2
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting Whoosh
  Using cached Whoosh-2.7.4-py2.py3-none-any.whl (468 kB)
Collecting conda
  Using cached conda-4.3.16.tar.gz (299 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]

      WARNING: Your current install method for conda only supports conda
      as a python library.  You are not installing a conda executable command
      or activate/deactivate commands.  If your intention is to install conda
      as a standalone application, currently supported install methods include
      the Anaconda installer and the miniconda installer.  If you'd still like
      for setup.py to create entry points for you, use `utils/setup-testing.py`.

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-r8zfpqqf/conda_d00c326857284b33a17fa8204184f848/setup.py", line 35, in <module>
          import conda._vendor.auxlib.packaging  # NOQA
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-r8zfpqqf/conda_d00c326857284b33a17fa8204184f848/conda/__init__.py", line 13, in <module>
          from .common.compat import iteritems, text_type
        File "/private/var/folders/lh/bk80lqb10yn5y40bxg593pv40000gn/T/pip-install-r8zfpqqf/conda_d00c326857284b33a17fa8204184f848/conda/common/compat.py", line 77, in <module>
          from collections import Iterable
      ImportError: cannot import name 'Iterable' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
mvdbeek commented 1 year ago

sorry, you're missing --upgrade. We're not installing conda at all anymore, that's all going through docker (when necessary).

fabianegli commented 1 year ago

OK. So the --update and --pre are required to get the command line tools installed. Would it then suffice to just change the installation instructions that the commands spit out?

mvdbeek commented 1 year ago

Like I said, we'll push new packages and that's it.

fabianegli commented 1 year ago
python3.10 -m venv venv
. venv/bin/activate
pip install --pre 'galaxy-tool-util[mulled]' --upgrade

installs the command line tools.

fabianegli commented 1 year ago

Not sure it should already work, but the following still fails for me:

python3.10 -m venv venv
. venv/bin/activate
pip install 'galaxy-tool-util[mulled]'

And mulled_search still suggests this installation method (same as in OP).