Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipx has trouble installing/running coala-bears #14

Closed
guykisel opened this issue Oct 21, 2018 · 4 comments
Closed

pipx has trouble installing/running coala-bears #14

guykisel opened this issue Oct 21, 2018 · 4 comments

Comments

@guykisel
Copy link

guykisel commented Oct 21, 2018

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!

@guykisel guykisel changed the title pipx can't run tools that install their binaries as dependencies pipx has trouble installing/running coala-bears Oct 21, 2018
@cs01
Copy link
Member

cs01 commented Oct 21, 2018

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
...

@guykisel
Copy link
Author

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

@guykisel
Copy link
Author

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

@guykisel
Copy link
Author

Closing as this is resolved, thank you.

gh271 pushed a commit to gh271/pipx that referenced this issue Jan 2, 2025
* Fix validation field on FPM pool endpoint

* Fix validation check to run on strings only

* Update CHANGELOG.md
gh271 pushed a commit to gh271/pipx that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants