Skip to content
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

Minor fix and improve #102

Merged
merged 11 commits into from
Aug 18, 2020
Merged

Minor fix and improve #102

merged 11 commits into from
Aug 18, 2020

Conversation

davidlatwe
Copy link
Collaborator

This PR propose to add profiles_path to allzparkconfig.py, which would optionally allow to exclude profile packages path from Rez's packages_path when working out side of Allzpark.

Beside that, this PR also...

  • A few doc strings been updated, and closed the if-statement clause in list_profile in 2df97d8.
  • Log messages' line break and space are now preserved in console widget.

@davidlatwe davidlatwe requested a review from mottosso August 17, 2020 13:36
@mottosso
Copy link
Owner

Thanks for this!

Now, what's the motivation? Was there a problem having profiles mixed with other packages? I'm not keen on making Allzpark behave differently from Rez on the command-line. It's meant to act as a visual version of that. This seems to produce different search results, one including profiles and the other not. :S

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Aug 17, 2020

Just found out that this profiles_path implementation missed one spot (and it's a TODO 😁 ) :

allzpark/allzpark/model.py

Lines 359 to 363 in 62ed58d

# TODO: This isn't nice. The model should
# not have to reach into the controller.
paths = self._ctrl._package_paths()

The profile package's "versions" cannot be found when viewing Package page.

Edit :
No need to worry about this now, at least in this PR.

@davidlatwe
Copy link
Collaborator Author

Now, what's the motivation? Was there a problem having profiles mixed with other packages?

Yes, mainly hope to opt-out profile packages when, for example using rez-search in command-line.
Since I think (at least on what I have known about Rez) using

$ rez-search --paths [profile path]

to find all profiles when needed, is nicer than filtering out profiles when you just need to find regular packages (which I imaging this would happens really often).

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Aug 17, 2020

This seems to produce different search results, one including profiles and the other not. :S

Yes, that was the idea :P

Oh, the profiles_path is optional, completely up to user preference.
I liked this was because I also made a package which provide a tool to create/build profile package and listing them.
Which allows me to manage them differently. :)

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Aug 17, 2020

Sorry for the chaos, I reviewed my changes again and looks like all I need was to add back those profile path in Controller._package_paths. :)

@davidlatwe
Copy link
Collaborator Author

looks like all I need was to add back those profile path in Controller._package_paths. :)

Hmmm.., after I found that and re-think about what you have said, instead of adding profiles_path in there, why not just use additional rezconfig.py with different packages_path setup ? 🤔

I'll revert the profiles_path feature, and leave those minor fixes. 🚧

@davidlatwe davidlatwe changed the title Add profiles_path Minor fix and improve Aug 17, 2020
@mottosso
Copy link
Owner

why not just use additional rezconfig.py with different packages_path setup ?

Ooo, yes that would be much preferable. I hope you get what I'm saying; it's important to preserve the use of command-line as an alternative to Allzpark. Allzpark is sugar on-top of Rez, nothing more. If you think of new features or use, we'll either have to find a way to do it with vanilla-Rez (like you seem to have done just now) or think long and hard about whether and how to deviate with Allzpark.

@davidlatwe
Copy link
Collaborator Author

davidlatwe commented Aug 17, 2020

After I switch to use additional rezconfig.py, I got an error says:

rez.exceptions.RezPluginError: Unrecognised package repository plugin: '/Users/davidlatwe/mongozark'

Turns out my mongodb based package repository path ([email protected]) got normpathsed here 👇🏼

def _package_paths(self):
"""Return all package paths, relative the current state of the world"""
paths = util.normpaths(*rez.config.packages_path)

I wonder, do we need this ?

@mottosso
Copy link
Owner

I wonder, do we need this ?

No you're right. This was a concious oversight, given the first user of the project was file-based only. We can safely remove that I think. Ideally, we'd normalise if we're sure it's a path (which I think we can programatically determine), but it's a luxury that the user can manage.

@davidlatwe
Copy link
Collaborator Author

but it's a luxury that the user can manage.

Yeah, and I think Rez doesn't change paths (e.g. normpath) as well, until the path hit into the package repository plugins.

With the last commit, everything works now.
I think I can call it a day. ☺️

@davidlatwe
Copy link
Collaborator Author

To visualize what changes did I made in commit 2b94ae6 :

Before

image

After

image

@mottosso
Copy link
Owner

I'm happy with this when you are, feel free to merge. :)

@davidlatwe
Copy link
Collaborator Author

Thanks :D
Merging this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants