Alternative to specifying a version from within the package.py.
Motivation
I was looking to generate lots of versions of a given package programmatically, but quickly realised there wasn't any way to specify a version other than by editing the package.py prior to calling rez build --install.
Beyond that, in porting an existing package management system to Rez, one of the differences was that the version wasn't given within the package definition, but rather during release.
$ other-system release --version 1.0.0
There isn't anything inherently wrong the current way versions are specified with Rez I think, nor with this other-system. However most of the time, changes you make are to the payload like Python module and so rather than having to also update the package.py due to technicalities, you could simply pass a version via the command-line.
These are essentially two different mindsets to releasing/installing packages. The current system has the advantage of being very specific, as one would need to remember the current version in order to increment properly, or look it up amongst released packages. The other-system didn't have to worry about that, because packages were published in context with the previous packages; in a GUI that visualised the currently available versions, which carried the additional benefit of visually indicating whether a chosen version was available or misformatted interactively.
Implementation
Provide an override to the version in package.py in the Rez CLI.
$ rez build --install --version 1.0
If --version was not provided, use package.py:version
If --version was not provided and there is no package.py:version, abort.
Extras
This could also be helpful for debugging, development and tutorials.
In my rez-for-projects repository, I'd like to provide example packages but also generate a repository of many versions. With this, I could have a script call rez build --version multiple times, with multiple versions to simulate a large repository. Without it, I would need to programatically open and write to each package.py prior to calling rez build; hacky
For performance testing, I'd like to generate a large mock-repository of packages with many versions. With this feature, I would hand-craft a few, and install lots of versions programatically
For debugging, I'd like to publish a copy of a repository as a *.beta and would need to edit the package.py for this to happen. Since I wouldn't want to keep or push this change, I would then need to remember to remove this temporary change once installed.
Goal
Alternative to specifying a version from within the
package.py
.Motivation
I was looking to generate lots of versions of a given package programmatically, but quickly realised there wasn't any way to specify a version other than by editing the
package.py
prior to callingrez build --install
.Beyond that, in porting an existing package management system to Rez, one of the differences was that the version wasn't given within the package definition, but rather during release.
There isn't anything inherently wrong the current way versions are specified with Rez I think, nor with this other-system. However most of the time, changes you make are to the payload like Python module and so rather than having to also update the
package.py
due to technicalities, you could simply pass a version via the command-line.These are essentially two different mindsets to releasing/installing packages. The current system has the advantage of being very specific, as one would need to remember the current version in order to increment properly, or look it up amongst released packages. The other-system didn't have to worry about that, because packages were published in context with the previous packages; in a GUI that visualised the currently available versions, which carried the additional benefit of visually indicating whether a chosen version was available or misformatted interactively.
Implementation
Provide an override to the version in
package.py
in the Rez CLI.--version
was not provided, usepackage.py:version
--version
was not provided and there is nopackage.py:version
, abort.Extras
This could also be helpful for debugging, development and tutorials.
rez build --version
multiple times, with multiple versions to simulate a large repository. Without it, I would need to programatically open and write to eachpackage.py
prior to callingrez build
; hacky*.beta
and would need to edit the package.py for this to happen. Since I wouldn't want to keep or push this change, I would then need to remember to remove this temporary change once installed.