Open MrLixm opened 9 months ago
Attention: 35 lines
in your changes are missing coverage. Please review.
Comparison is base (
b593438
) 81.91% compared to head (3dc8b08
) 81.68%.
Files | Patch % | Lines |
---|---|---|
src/rez_pip/main.py | 37.73% | 31 Missing and 2 partials :warning: |
src/rez_pip/rez.py | 91.66% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @MrLixm thanks a lot for creating this PR and for the great PR description :)
First of all, rez-pip was not designed to be used as an API. I made design choices knowing full well that the API wouldn't be useable as is. That was kind of intentional.
Could you explain in more details what use cases you are facing that rez-pip doesn't cover or what kind of use cases this would enable? I know that we need to fix a couple of bugs, for example the name casing thing or even how PySide is handled. To fix some of these, I've been thinking about implementing a lightweight plugin system that would allow to create hooks, similar to how PyInstaller solves these problems.
Basically, before opening the doors to a public API, I'd like to see if we can look at hooks or other solutions.
Would you like to collaborate on such an effort? I'm definitely searching for collaborators that are active users to make sure that the solution we come up with fits the needs of users.
Let me know what you think.
Hello,
Nice to know. I still think for now a public API can be useful, even if minimal. And by minimal I mean instead of doing a subprocess.call()
to rez_pip
, just having access to the top-most-level function that the CLI is calling to avoid going through subprocess to reproduce the same behavior.
My current context is I am trying to ensure a robust deploy pipeline for pip packages. You can't have any developer calling rez_pip XXX --release
affecting the rez central repository without leaving trace of why and how they did it.
So my goal is to have version controlled repository that contain a "install script" for every pip package. So if one would run all those scripts on a fresh new central repository, you would get a mirror of the current one.
This could be in theory just a bunch of powershell/shell scripts that call the CLI, but with the current limitations and issues of rez_pip I have found myself in need of doing a lot of workaround that are made much easier in python. You could argue that you should not decide to change the scope (CLI > library) of a tool because it is currently missing feature and you'd be right, so it is indeed important to have a look if its really pertinent.
Here is some of my current needs:
python
packages have non-standard versioning, in the end rez_pip just needs an official python version for pip, and a python executable. It would be great if I could directly provide those without rez_pip guessing them in-between.I would be very happy to collaborate with you if I can be of any help.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
No data about Duplication
Hello, I don't know if it was in the goal of rez_pip to be usable as a python library and not only as a CLI, but given its current "WIP" state I found myself in need of such behaviour so I could further custom rez_pip behaviour.
The goal is to have rez_pip part of a larger python script, doing the heavy work of installing pip package, but allowing to retrieve those for further manipulations.
changes
⭐ Extract the
cli._run
private function to a newmain
module, asrun_full_installation
function.⭐ Split
run_full_installation
into an additional lower-level functionrun_installation_for_python
have
rez.createPackage
return therez.package_maker.PackageMaker
object createdhave new
run_full_installation
function return a dict of rez package created for each python version, dependent on previous change.⭐ add a
creationCallback
parameter torez.createPackage
andmain.run_full_installation
(in f7b6519ef2220c31d6561d302d5c043674436505)extract 2 functions from
rez.getPythonExecutables
:getPythonExecutable
andfindPythonPackages
change some variable to be
pathlib.Path
objects instead ofstr
(in 13b7ee41256f57eae1d1b58928757533027ab921 and a184ebf9a8d64f10d5c33f657ee9cf31cba6a558)what to review
Not all those changes are necessary for the initial need. Do not hesitate to oppose to some of them if you think they are not pertinent.
Essential changes are marked with a ⭐ emoji.
notes
I intended commit history to be pretty clean but I actually did some change I choose to revert later for maintaining simplicity.
pitfalls
After a few test it seems rez_pip log/print system is not designed for a library use for now. But we could perhaps address those in another PR.
misc suggestions
Not related to this PR but were found during the development process.
release
param fromrez.createPackage
, instead only use theprefix
param to determine the path of the installation (that could also be renamed to be more explicit).rez.getPythonExecutables
togetPythonExecutableFromRange
?example
Here is a contextual use-case (in reference to issue #88 ):
todo
run_full_installation