Open jamesstidard opened 6 years ago
Doesn't pipenv suggest the use of pipsi to do its installation? Isn't that a bit like a chicken and egg problem?
Also pipenv is all for developers and managing dependencies, whereas pipsi is about installing a tool and making it available in a stable bin path with managed virtualenvs. You don't need 90% of what pipenv provides in pipsi.
@bertjwregeer that's a good point. Now you mention it, I think I got carried away getting to pipenv
. It would really only be a pyenv
integration that would be needed to do what I was after - selecting/installing the right interpreter for the tool and making the virtual environment as normal.
Does that sound a little more sensible?
I just came across this thinking that I'd be able to type/think less in the future if pipsi
realised that I don't have a python that matches the requirements of black
(3.6) so went ahead and installed/used on in the virtualenv
it made for it. Maybe I should just use containers for everting :thinking:
@bertjwregeer @jamesstidard I don't think it's a chicken/egg problem.
rm -rf ~/.anaconda3
I personally think Pyenv, Pipsi, and Pipenv serve different purposes and should be installed as "siblings". One manages Python installations, another is a secondary package manager for system-wide Python applications, and the third is a virtual environment manager. All three are "top-level" in my mind, just below the system package manager in terms of management authority.
pyenv integration is tricky - it needs support in both the package and the installer + a new release - im not familiar with pyenv myself and dont use it
it needs support in both the package and the installer + a new release
@RonnyPfannschmidt what do you mean by that?
Currently you have: https://github.com/mitsuhiko/pipsi/blob/16b6820c02ea84ffbbf1d48a6773829831308359/pipsi/__init__.py#L310-L316
In this case you would change it to something like
if isinstance(python, int):
python_version = python
python_exe = get_executable_name(python_version)
python = get_executable_path(python_exe)
if not python:
raise ValueError('Can not find {} in PATH'.format(python_exe))
elif python == 'auto':
python_version = get_minimum_python_version(package)
executable_name = get_executable_name(python_version)
python = get_executable_path(executable_name)
elif python and PYENV_INSTALLED:
pyenv = Pyenv()
pyenv_installed = pyenv.list_installed()
if not check_if_in_path(python) and python not in pyenv_installed:
pyenv.install(python, ask_confirmation=True)
python = pyenv_installed[python].get_path()
else:
python = sys.executable
Pyenv is just shell scripts. The hardest part would be writing wrapper methods to that parse its output.
i wouldn't change it at all since i'm not at all fluent in pyenv and dont use it myself - this has to come from someone that knows the details enough not to make a broken mess
That's fine. When I have some more time maybe I can experiment with this.
I will have to figure out testing, I've never written any tests for a piece of software like this before.
I currently use
pyenv
andpipenv
on my machine to manage python versions and package dependencies - I assume people that usepipsi
are quite likely to do the same. I feel like it would be nice to build the virtual environment for installed packages usingpipenv
- if it's present on the system.pipenv
already has an integration withpyenv
where it'll download the python interpreter viapyenv
, if it's not already. Currently you can specify a specific python interpreter with--python
, but before this you need to:pyenv
--python
argumentI think by using
pipenv
to create the virtual environment on install and updatepipsi
could remove those steps as well as automatically upgrade python interpreters for each application as a package owner depreciates them.Would there be anything inherently sinful about this feature? I'm happy to have a go at implementing this if this seems like a feature
pipsi
would benefit from.