pipx has trouble installing/running coala-bears

Created on 21 Oct 2018  路  4Comments  路  Source: pipxproject/pipx

Hi, pipx looks like a cool tool!

I'm trying to run a meta-linter named https://coala.io/ in pipx. Coala installs a lot of dependencies that often end up conflicting with other installed tools, so pipx seems perfect for running it. However, the recommended installation for Coala is pip3 install coala-bears, which installs the Python coala package (which includes the binary you actually run) as a dependency. Because of the indirect nature of making the binary available, pipx seems to be unable to find it.

$ pipx install coala-bears
No binaries associated with this package.

Running pipx install coala directly does work, but results in not having any of the necessary dependencies to run the various linters.

After running pipx install coala-bears, I actually can successfully run pipx coala even though it claimed there were no binaries. However, I'm unable to pass in arguments:

$ pipx coala --show-bears
usage: 
    pipx [--spec SPEC] [--python PYTHON] BINARY [BINARY-ARGS]
    pipx {install,upgrade,upgrade-all,uninstall,uninstall-all,list} [--help]
pipx: error: unrecognized arguments: --show-bears

I realize there's a lot of information to absorb here :P Is there anything obvious I'm doing wrong?

(additional note: pipsi also has a hard time with coala-bears, so I think coala is a bit of an edge case as far as trying to run Python stuff in an isolated environment)

For reference:

Thanks!

All 4 comments

Thanks for filing the issue! I made an update to the way pipx parses arguments which will fix the pipx: error: unrecognized arguments: --show-bears error. You will need to update pipx to get the fix:

pipx update pipx

You are right about the indirect nature causing a problem when trying to run coala directly. But pipx can handle this use case! These are the commands you want to run. The --spec argument is passed to pip install, after which the binary coala is expected to be available.

To run once in ephemeral environment:

pipx --spec coala-bears coala --show-bears

or to install globally and have available at any time

pipx install --spec coala-bears 
coala --show-bears

I tested it and got

>> coala --show-bears
[WARNING][19:57:04] The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
[WARNING][19:57:05] StyleLintBear: Using unnecessary capturing groups affects the performance of coala. You should use '(?:<pattern>)' instead of '(<pattern>)' for your regex.
AlexBear
AnnotationBear
BanditBear
BootLintBear
CheckstyleBear
...

Wow, you're fast! I'm super impressed :) I'll give it a shot and report back. Thank you so much <3

It worked! Note that for the global install option, I actually needed to run: pipx install --spec coala-bears coala

Closing as this is resolved, thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

z0rc picture z0rc  路  10Comments

floatingpurr picture floatingpurr  路  5Comments

pfmoore picture pfmoore  路  6Comments

Crocmagnon picture Crocmagnon  路  4Comments

cs01 picture cs01  路  4Comments