ipm
ipm copied to clipboard
enhance: allow specifying pip/pip3 path
Allow specifying path to pip or pip3 for installation of requirements.txt.
On many Unix systems, pip command is a symlink to pip3 located somewhere on $PATH. In some cases, pip can be nonexistent and there's only pip3.
With this PR, users can specify path to pip/pip3 by running config set PipPath xxxx in zpm. Otherwise, the default location is wherever pip3 first appears on $PATH. This allows for maximum compatibility.
@isc-shuliu the docs seem to indicate that python -m is right for 2024.2+ but irispip is to be used for Windows on 2024.1 and earlier. Done right this would also fix #540.
CI failures are because the 2023.2 built-in license expired. We should cut that from CI.
For 2024.2 / flexible python runtime I think the python executable should be located based on PythonRuntimeLibrary - gave this a try without it (and with WSGIApplication ported to v1, which we still need to do) and I'm running into issues because of different python versions being in play.
For <=2024.1 and Windows specifically, I think we need to stick with irispip to get things right.
@isc-tleavitt What is PythonRuntimeLibrary? Is it a $System function or something else?
@isc-tleavitt
I made the changes to check for <IRIS-ROOT>/bin/irispip.exe first. If found, it will use that on windows. For 2024.2+, where irispip.exe doesn't exist, we proceed to check for python3.exe -m pip and python.exe -m pip.
For Unix, we still use python3 -m pip and python -m pip, whichever found first.
Does that make sense?
@isc-shuliu thanks - that's progress.
The problem is that we're finding python3/python based on the path, and it's possible if not likely that there would be multiple versions installed. It looks like, from some basic experimentation, if we pip install with the wrong version things end up broken. You know Python way better than I do - does this sound right? (looks like related to having the wrong cpython stuff)
Re: PythonRuntimeLibrary, see: https://docs.intersystems.com/iris20242/csp/docbook/Doc.View.cls?KEY=RACS_PythonRuntimeLibrary - this is new to 2024.2
This should also fix #546