rez icon indicating copy to clipboard operation
rez copied to clipboard

Implements #426: Allow to define multiple local/release folders

Open bfloch opened this issue 8 years ago • 16 comments

Fixes #426.

All tests pass. For the sake of clean implementation it does break config compatibility (to some little degree). For example:

local_packages_path = "~/packages"
release_packages_path = "~/.rez/packages/int"

Becomes:

local_packages_paths = ["~/packages"]
release_packages_paths = ["~/.rez/packages/int"]
packages_index = 0

bfloch avatar May 16 '17 20:05 bfloch

Hey Thanks Blazej,

One thing though.. it breaks compatibility, as in local_packages_path etc must be a list now? I can't introduce breaking changes though, I put a lot of effort into ensuring that rez stays backwards compatible unless breaking changes are absolutely necessary. Happy for the fix but it does have to be backwards compatible.

Cheers A

On Wed, May 17, 2017 at 6:02 AM, Blazej Floch [email protected] wrote:

Based on the request at #426 https://github.com/nerdvegas/rez/issues/426 .

All tests pass. For the sake of clean implementation it does break config compatibility (to some little degree). For example:

local_packages_path = "~/packages" release_packages_path = "~/.rez/packages/int"

Becomes:

local_packages_paths = ["~/packages"] release_packages_paths = ["~/.rez/packages/int"] packages_index = 0


You can view, comment on, or merge this pull request online at:

https://github.com/nerdvegas/rez/pull/428 Commit Summary

  • Implements #426: Allow to define multiple local/release folders

File Changes

Patch Links:

  • https://github.com/nerdvegas/rez/pull/428.patch
  • https://github.com/nerdvegas/rez/pull/428.diff

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/pull/428, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjqSmCzonuGOkKsfZujn6HMCZYW2waTks5r6gDUgaJpZM4NdAhC .

nerdvegas avatar May 17 '17 22:05 nerdvegas

Changes based on the comments in https://github.com/nerdvegas/rez/issues/426#issuecomment-302254762 It acts like usual with old settings (strings).

I've added the labels as suggested. I took the liberty to also add them to non local packages in case there is a package_paths_index. This helps navigation.

If there are no multiple projects then the output is as is. Else it looks something like:

requested packages:
qtpy
realm
~platform==linux  (implicit)
~arch==x86_64     (implicit)
~os==CentOS-7.2   (implicit)

resolved packages:
arch-x86_64             ###################################          (internal)
logger-0.2.0            ###################################          (internal)
os-CentOS-7.2           ###################################          (internal)
platform-linux          ###################################          (internal)
qtpy-1.0.0b3.tbe1       ###################################          (local: thirdparty)
tool-0.26               ###################################          (local: internal)
rez-2.0.rc1.39          ###################################          (thirdparty)
config-0.1.0            ###################################          (internal)

bfloch avatar Jun 30 '17 22:06 bfloch

Looks great Blazej, cheers

On Sat, Jul 1, 2017 at 8:16 AM, Blazej Floch [email protected] wrote:

Changes based on the comments in #426 (comment) https://github.com/nerdvegas/rez/issues/426#issuecomment-302254762 It acts like usual with old settings (strings).

I've added the labels as suggested. I took the liberty to also add them to non local packages in case there is a package_paths_index. This helps navigation.

If there are no multiple projects then the output is as is. Else it looks something like:

requested packages: qtpy realm ~platform==linux (implicit) ~arch==x86_64 (implicit) ~os==CentOS-7.2 (implicit)

resolved packages: arch-x86_64 ################################### (internal) logger-0.2.0 ################################### (internal) os-CentOS-7.2 ################################### (internal) platform-linux ################################### (internal) qtpy-1.0.0b3.tbe1 ################################### (local: thirdparty) tool-0.26 ################################### (local: internal) rez-2.0.rc1.39 ################################### (thirdparty) config-0.1.0 ################################### (internal)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/pull/428#issuecomment-312384688, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjqSvu0Mp4xNjZTcOiwH0Omd3x-2EiSks5sJXPPgaJpZM4NdAhC .

nerdvegas avatar Jul 01 '17 01:07 nerdvegas

I updated rez-bind so that a manual --target-packages-path can be given.

Btw. in any misconfiguration a ConfigurationError is raised. For example:

rez-bind -t doesnotexist --no-deps rez
11:38:53 ERROR    ConfigurationError: Invalid target_packages_path "doesnotexist" for local

bfloch avatar Jul 11 '17 15:07 bfloch

Hold your horses. I found a weird bug (maybe regression on the feature) where a local package is not recognized correctly. Give me a sec.

bfloch avatar Jul 11 '17 16:07 bfloch

Ok this includes the bugfix as well as fixes the label to be more accurate even if no config override is given in the package (by comparing the repository paths).

The bug was introduced by the property that I created that overrides the config value. I needed to reference back the original data, else I am already using a single value.

Anyhow this works for me now.

bfloch avatar Jul 11 '17 19:07 bfloch

I will do some more testing over the week.

bfloch avatar Jul 11 '17 20:07 bfloch

Just a heads up. We have this in production since the original date. If you ever plan the next minor or major version consider this. It is backwards-compativle / non-destructive to existing package-definitions.

I would love to have someone external do some testing.

bfloch avatar Jan 11 '18 05:01 bfloch

Hey Blazej, I think I'll be getting to this in the next week actually, so keep an eye on the releases.

Cheers A

On Thu, Jan 11, 2018 at 4:09 PM, Blazej Floch [email protected] wrote:

Just a heads up. We have this in production since the original date. If you ever plan the next minor or major version consider this. It is backwards-compativle / non-destructive to existing package-definitions.

I would love to have someone external do some testing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/pull/428#issuecomment-356827092, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjqSoIkRuW7EsynfIwKoexwC1L3J42Jks5tJZeTgaJpZM4NdAhC .

nerdvegas avatar Jan 12 '18 21:01 nerdvegas

Let me know if you need me to change anything. I can also write documentation once we have it merged.

bfloch avatar Jan 17 '18 18:01 bfloch

@nerdvegas @bfloch Hey, any news in that pr?

adriankrupa avatar Feb 22 '18 10:02 adriankrupa

I'm getting to this soon, another project is taking up my time at the moment but this is top of my list.

Thx A

On Thu, Feb 22, 2018 at 9:52 PM, Adrian Krupa [email protected] wrote:

@nerdvegas https://github.com/nerdvegas @bfloch https://github.com/bfloch Hey, any news in that pr?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/pull/428#issuecomment-367644020, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjqSiSw-H9hrHOZt6M3xnm0MrzniNifks5tXUbVgaJpZM4NdAhC .

nerdvegas avatar Feb 23 '18 00:02 nerdvegas

I hope that fixed the minor conflict.

bfloch avatar Feb 23 '18 04:02 bfloch

Heads-up, this breaks backwards compatibility with the API. :(

For the usecase of separating releases into /int and /ext, isn't this what the package_preprocess_function is for?

Makes sense for the --no-local argument however.

mottosso avatar Jun 26 '19 06:06 mottosso

Hey @bfloch,

Apologies I never got back to this PR. I'm making a concerted effort recently to get on top of development, and I'll be revisiting this. I did run into some issues that stopped me from merging it, so in the coming weeks I will get a chance to go over the PR again and make some comments.

FYI, I'll be out of contact over the next 3-4 days as my family and I are moving house. If you can't contact me, that's why!

To expand on what @mottosso has said, yes you can achieve the same goal using a global preprocessor - it would simply read some custom package attribute, and alter release_packages_path appropriately. The same would work for local_packages_path also. However, what that would not do is make rez aware that there are multiple local package paths. So options like --no-local wouldn't respect that, and the output of rez-context would only show (local) for the one configured local_package_path.

nerdvegas avatar Jun 26 '19 06:06 nerdvegas

@mottosso Yeah, internally we went with the config in the packages, but it killed the no-local option which caused some confusion, especially since the print-out becomes misleading.

@nerdvegas Yeah it's been a while. Looking forward to your comments. I'd gladly give it another shot. I remember vaguely that there is more tools which would need to be aware of the paths, so I'll have to take a look at it myself.

bfloch avatar Jul 05 '19 21:07 bfloch