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: Need a way to specify pipx parameters #8656

Closed
1 task done
sieberst opened this issue Jul 19, 2024 · 11 comments · Fixed by #8675
Closed
1 task done

pipx: Need a way to specify pipx parameters #8656

sieberst opened this issue Jul 19, 2024 · 11 comments · Fixed by #8675
Labels
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)

Comments

@sieberst
Copy link

sieberst commented Jul 19, 2024

Summary

I want to install two different versions of conan (conan 1.x and conan 2.x) in parallel via pipx by renaming the binary of the conan 2 installation as "conan2". This can be done with the pipx parameter "--suffix 2", but there is currently no way to supply such pipx parameters in the Ansible task. So we need 'pipx_args' similar to the existing 'pip_args'.

Issue Type

Feature Idea

Component Name

pipx

Additional Information

    - name: Install conan 2 as conan2 with pipx
      community.general.pipx:
        name: conan
        pipx_args: "--suffix 2"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

cc @russoz
click here for bot help

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module plugins plugin (any type) labels Jul 19, 2024
@felixfontein
Copy link
Collaborator

Generic module options like pipx_args are generally a Very Bad Idea. Having a specific module option for some unsupported parameter is a far better choice.

@sieberst
Copy link
Author

I'm also fine with a specific parameter like "suffix":

      community.general.pipx:
        name: conan
        suffix: "2"

@russoz
Copy link
Collaborator

russoz commented Jul 22, 2024

Hi @sieberst Thanks for raising this issue! :-) Adding parameters should be very straightforward. This --suffix parameter has been marked as experimental since ever, so I did not bother to implement it before. Now that someone is asking for it seems like a good time to do it. The PR should be coming out along this week (hopefully).

@russoz
Copy link
Collaborator

russoz commented Jul 22, 2024

As a matter of fact, the pipx integration tests are currently disabled in the CI - long story - and running locally here I see that something got broken during this time. I should be fixing that first, then adding this feature.

@gaby
Copy link

gaby commented Aug 1, 2024

@felixfontein @russoz The PR doesn't solve this ticket, which is the lack of pipx_args.

In pipx v1.6.0 support for --global was added to all the cmds, this creates a venvs for all users. There's other options completly un-accesible via ansible.

Is the plan to add each single option in pipx to ansible? There's already a pip_args, why not just add pipx_args and let the user make that decision.

@felixfontein
Copy link
Collaborator

The PR doesn't solve this ticket, which is the lack of pipx_args.

In that case this ticket has to be closed since that won't get implemented anyway. Options such as pipx_args are dangerous and prevent correct implementation of most other features.

@sieberst
Copy link
Author

sieberst commented Aug 1, 2024

As I already commented in the past, I'm fine with the solution of the PR, the reason I asked for a more generic pipx_args solution was that I thought it would be more useful to have a generic solution and I didn't expect it to be a problem given the existing pip_args parameter.

@russoz
Copy link
Collaborator

russoz commented Aug 1, 2024

@felixfontein @russoz The PR doesn't solve this ticket, which is the lack of pipx_args.

In pipx v1.6.0 support for --global was added to all the cmds, this creates a venvs for all users. There's other options completly un-accesible via ansible.

Is the plan to add each single option in pipx to ansible? There's already a pip_args, why not just add pipx_args and let the user make that decision.

As Felix explained, yes, that would be the right way to go. I am happy to implement --global or any other parameter you'd like, it is not a complicated feat. I just have not had the time to keep track of all changes in commands. Could you please help point them out - in a new issue? That would be much appreciated.

@gaby
Copy link

gaby commented Aug 2, 2024

@russoz Sounds reasonable, I will create a separate issue for --global. Newer Ubuntu distributions fail if you try to install global pip packages and this pipx flag fixes that. Thanks!

Issue has been created #8705

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants