-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Install as package #579
[Feature] Install as package #579
Conversation
Hi @j0yu , this is pretty useful, we made rez as a package 4 years ago, but I think it was more complicated, maybe because our enrvironment with CentOS-6. I sort of remmeber that one of the problem is the python version that is shipped with rez. I'll dig in the history, but from memory and at first glace seems quite different to this. |
d4f83f6
to
5a02944
Compare
Solved once wheel and pypi support get merged. $ rez wheel --install rez==2.30.0 |
Hi @j0yu, just letting you know I'm aware of this PR and I agree with the functionality. I'm just waiting til after there's some work on updating the installer, which will be happening within a few weeks. I'll either merge or cherrypick from this PR as part of that effort. Thx |
@mottosso Interesting! I'll give it a test and maybe even port this functionality over so you can directly during install using pip install --install-option="--as-package=rez" Great stuff on #614 and #625, so right now I'm looking to run something like these? $ pip install --user bleeding-rez # I'll see if I can add --install-option here to do "rez wheel" after install
$ rez wheel --install rez==2.31.4
Thanks @nerdvegas, I'm happy to rebase this branch over whenever the installer is updated. Just drop a message on here and I'll update this PR to the latest master branch. I saw there's a lot of discussion about |
Yes, that's exactly right! Except at the moment $ pip install --user bleeding-rez
$ rez pip --install bleeding-rez # wheel got renamed back to `pip` in the bleeding-rez version And you'd have Rez both on your system and as a package.
Double inception! Haven't thought of that, let me know how that goes. |
5a02944
to
00165a0
Compare
00165a0
to
0f2d263
Compare
I just tested this, but it creates a very strange rez package:
See in its commands:
A rez package of rez should just be the rez API, independent of whatever the current installation is. It's entirely feasible to have (for eg) installed rez-2.40.0, but rez package ~/packages/rez/2.39.0, and so on. This is actually pretty normal at Method for eg - our installation is updated first, and the rez rez package is deployed later, once the installation has been tested for a while. As it happens, I've just done some testing with the recent rez-pip improvements, and this actually works very well:
I think this approach should be fine, as rez-pip is installing directly from source here, and doesn't need to download anything. There's a little massaging to do though - namely, the bin tools should be removed (because they are only guaranteed to function correctly in a production install); as well as a couple more subtleties that I won't delve into here. So my thoughts at the moment are that we should:
|
I'm inline with what @nerdvegas said. Though, I think differently of adding a I would also add that we could make the package variant'ded (on python) so that it is only usable when using a compatible python version. That is it cannot be used with python 3 for example. Or the day we fully support python 3, then only specify the python versions with which it is compatible with (wild guess will be
In which case can this happen? Also, should we deprecate the |
Thanks for the feedback, I should have mentioned that I just did a basic rebase I haven't fully tested it with the new I agree with the comments, so I'll crack on and see how much of these I can get done:
Not sure how/if I should do something in this PR for that @nerdvegas? Something like:
|
On another note, @nerdvegas is |
You have to build the wheel locally as builds are not yet published to pypi |
The pip installation should occur from the local source. Any option to install rez as a rez package, from I mentioned a few caveats about installing rez via rez-pip; they're worth going over here. The first is cli tools. The rez rez package doesn't have any, yet rez-pip will create them. So I am actually thinking... since pip-installed rez cli tools aren't safe anyway, maybe we should remove them altogether? We could do this simply by providing an empty entry point list in setup.py, unless some env-var is set (which only install.py would set). This seems clean to me - it removes potentially unsafe cli tools, and it means one less caveat for rez-pip-installing rez itself. It also means we don't need any warnings in the docs/tools about those tools potentially misbehaving. The second is varianting. The rez-pip tool variants on python-MAJOR.MINOR, even if it could theoretically variant on a looser python version range. The reasons for this have been gone over elsewhere, but the short of it is, due to python "environment markers", it's possible to end up with odd/overlapping python version ranges. However, we know that rez doesn't need to be varianted on MAJOR.MINOR - in fact, pretty soon (when py3 port is finished) it won't need to be varianted at all, and instead could just require To address the varianting issue, I wonder if we could do it in a general way. Is it possible to author metadata in a python package, that could communicate this (and potentially other) info to rez? Ie, can we embed into into a native python package, about how it should be varianted in rez? I think this would be the best approach, as it would solve an issue specific to this PR, as well as being a generally useful new feature. |
6e1fa90
to
d9f0a86
Compare
So I started to get back onto this again but I've decided to go step by step and return the scope of this PR to the original, simpler quest of: Can I run I feel there's more opportunities to get I've also update the PR description too with some bits I picked out from the discussions |
e8f7b03
to
bd1564b
Compare
1290d87
to
591915a
Compare
591915a
to
66ee1be
Compare
See #845 |
Added
-p
and-P
options during install to installrez
as a package under the given install directory (typically a packages)For now, this PR will only focus on
install.py
to perform a production friendly install just requiringpython
. The rez package will be setup up with the variants:platform-
system platform name (e.g.linux
), andpython-MAJOR.MINOR
for the Python version used to runpython install.py
So far, it is not intended to replace
rez bind rez
, but maybe at some point (see below).It does install the rez package in a similar structure and performs package commands to setup the following:
{root}/bin/rez
intoPATH
{root}/lib/python*//rez*
into{root}/python
(for clean Python imports ofrez*
modules){root}/python
intoPYTHONPATH
e.g. for commit d987f7d
python install.py --help
python install.py -p ~/packages will install as:
rez view rez
This feature was originally suggest for v2.27 but has been rebase'd and adapted to the latest rez versions since. Needless to say, the various evolution and improvements to rez has put this feature in an interesting spot.
Highlights from discussions below
pip install compatible
rez
now usespip install
internally ininstall.py
! Therefore after downloading/git clone
this repository, one can install rez via several methods (assuming you're running from same folder as rez'sinstall.py
/setup.py
):In the current state of this PR/feature, it more closely follows
1
. It's able to installrez
even if rez is not currently installed.Since pip based
2
and3
installs do not install rez into a venv, more work will need to be done to this PR to get it to bepip
friendly. See #579 (comment), #579 (comment), #579 (comment)Deprecate rez bind rez
Since this PR installs into a similar structure/package declaration as the rez package produced by
rez bind rez
, given some extra work, maybe even this PR can deprecate the rezrez bind
.rez bind rez
currently sets up only the rez Python modules into arez
package. This is similar to thepip
style installs (2
and3
), but just without thebin
folder/tools.See #579 (comment), #579 (comment)