pipx icon indicating copy to clipboard operation
pipx copied to clipboard

Add `install-all` command

Open dukecat0 opened this issue 2 years ago • 9 comments

  • [x] I have added an entry to docs/changelog.md

Summary of changes

Closes #687

Test plan

Tested by running

pipx install-all packages.json

dukecat0 avatar Jul 19 '22 06:07 dukecat0

Thank you for this. Although, most of repos that I want to run it doesn't have the packages.json. I want to run pipx install-all requirements.txt

A1vinSmith avatar Aug 02 '22 04:08 A1vinSmith

Even on where the manifest does exist, it’s still tedious for most users to have to dig out the file manually. It’s probably better for us to add something like pipx freeze (or export? something else?) to couple with this.

uranusjr avatar Aug 02 '22 05:08 uranusjr

Even on where the manifest does exist, it’s still tedious for most users to have to dig out the file manually. It’s probably better for us to add something like pipx freeze (or export? something else?) to couple with this.

That sounds nice. Maybe even pipx install-all-rtxt that includes two commands above.

A1vinSmith avatar Aug 02 '22 05:08 A1vinSmith

pipx install-all packages.json

This packages.json is the output of pipx list --json, and it's a little bit different from requirements.txt, but I am +1 on supporting requirements.txt.

dukecat0 avatar Aug 02 '22 06:08 dukecat0

Supporting requirements.txt would probably be unnecessarily complicated since the format lacks a lot of structure we need to for metadata besides just packages. I’d stick with just supporting our own JSON manifest.

uranusjr avatar Aug 02 '22 06:08 uranusjr

It’s probably better for us to add something like pipx freeze (or export? something else?) to couple with this.

I guess the output of pipx freeze would be quite similar to the output of pipx list --json, while pipx freeze doesn't have to contain info that wouldn't be used by pipx install-all.

dukecat0 avatar Aug 02 '22 15:08 dukecat0

Yeah, and also it can have options like --output to make it easier to forward things to a file without shell syntax.

uranusjr avatar Aug 06 '22 02:08 uranusjr

This is exactly what I'm looking for! :)

Should python-version be read from the dump-file? Is it better to not include that and let the install command figure it out itself? What if the version doesnt exist on the system?

xeor avatar Aug 18 '22 20:08 xeor

Should python-version be read from the dump-file?

Some packages have limitations on the Python version, so python-version has to be read from the file.

What if the version doesnt exist on the system?

They will get an error and then they can install the package manually with pipx install <packages>

dukecat0 avatar Aug 19 '22 06:08 dukecat0

This would solve most of what I would want in #952, but would it also automatically inject packages?

   package mkdocs 1.4.2, installed using Python 3.11.3
    - mkdocs
    Injected Packages:
      - mkdocs-material 9.1.8
      - mkdocs-mermaid2-plugin 0.6.0
      - mkdocs-redirects 1.2.0
      - mkdocs-simple-hooks 0.1.5

From my perspective as well, it would be useful to have missing Python version values assume the use of the (default) version, as most of the packages I install are simply done with pipx install <package> and haven’t yet found one that requires a specific Python (which is good, because I don’t actually plan on having multiple versions installed; I don’t develop software in Python, but I happily use many of the amazing tools).

halostatue avatar May 05 '23 15:05 halostatue

but would it also automatically inject packages?

Currently no, but I will implement it in the future.

dukecat0 avatar May 05 '23 17:05 dukecat0

Seems stalled, we can reopen if you pick it up again.

gaborbernat avatar Jan 31 '24 00:01 gaborbernat