mitsuhiko / pipsi

pip script installer
Other
2k stars 133 forks source link

Installing multiple versions of the same python package #77

Open ginkel opened 8 years ago

ginkel commented 8 years ago

This isn't a bug report, but more of a question: Is there a way to use pipsi to install multiple versions of the same package in parallel? E.g., ansible==2.0.2.0 as ansible2.0 and ansible==2.1.0.0 as ansible? ATM pipsi refuses to install additional versions, because it seems to ignore the version specification to distinguish different venvs.

RonnyPfannschmidt commented 8 years ago

currently that is not supported, its also not clear how to support this without metadata about the envs

ginkel commented 8 years ago

One naive idea would have been to name the envs accordingly, i.e., ansible==2.0.2.0 is installed to an env named ansible-2.0.2.0. Binaries would be linked as ansible-2.0.2.0, ansible-playbook-2.0.2.0, and so on... Do you think more metadata would be needed?

sean-abbott commented 7 years ago

I would add an "update alternatives" componenet to it as well..link the versioned executables, but then also allow a selector that says "show me the available versions, and let me choose which one I want linked to the primary binaries".

Again, naively, you should be able to have a list of scripts you're going to link from a given setup file, although it's possible that could change between versions...

I also have this need, with ansible being the main driver. :-)

pjz commented 7 years ago

A start might be a way to tell pipsi to:

  1. install the package in a venv whose name I can specify but without linking anything into the bin-dir pipsi install-as ansible-2 ansible==2.0.2.0
  2. link the binaries from the specified venv into the (maybe specified) bin-dir, using the specifed name pipsi link ansible-2 ansible ansible2 pipsi link ansible-2 ansible ansible2 --bin-dir /path/to/bin

Both of these things are fairly simple, I think, and potentially worth doing individually anyway. pipsi link would allow the links to pipsi to be more easily moved/copied from the bin-dir that was specified at install time. Combine it with install-as and it's possible to use pipsi to manage a farm of python utils where, for instance, ansible 1 is in one project's bin directory while ansible 2 is in a different project's directory.

RonnyPfannschmidt commented 7 years ago

that was my plan before i stopped using pipsi in favour of nix

sean-abbott commented 7 years ago

Are you using nix to give you isolated venvs for python tools, or are you using nixos? If the former, is there a guide to doing that?

RonnyPfannschmidt commented 7 years ago

i do both - i used nox before, now i also use nixos, there are guides for using nix on other distros