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

SUGGESTION: Tying into tk-multi-launchapp's {version} substitution to help resolve rez package version(s) #4

Closed
sreenathan-nair opened this issue Jul 25, 2020 · 1 comment · Fixed by #7
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@sreenathan-nair
Copy link

Hi,

First off, thank you very much for all your work and sharing this! It has been very helpful.

I wanted to give a suggestion regarding having multiple version definitions in a single launchapp block. (I apologize if the feature is already in the works, just thought I'll mention my findings here).

I had a situation where multiple versions of Maya needed to be configured where the only variable was the version while all dependencies remained the same. Rather than duplicating the launchapp block I hooked into the versions key available in launchapp to define this, like so:

settings.tk-multi-launchapp.maya:
  engine: tk-maya
  versions:
    - "2020.2"
    - "2020.0"
  extra:
    rez:
      packages:
        - "maya-{version}"
        # My plugin(s) contain variant definitions for each maya version and therefore resolve appropriately
        # - <plugin>-<plugin_version>
      parent_variables:
        - PYTHONPATH
        - MAYA_MODULE_PATH
        - MAYA_SCRIPT_PATH
  menu_name: "Maya {version}"
  group: "Maya"
  location: "@apps.tk-multi-launchapp.location"
  hook_app_launch: "{config}/tk-multi-launchapp/rez_app_launch.py"
  linux_path: "maya"
  mac_path: "Maya.app"
  windows_path: "maya.exe"

In order to make this work, I had to slightly alter:
this

to

rez_packages = [package.format(version=version) for package in rez_info.get("packages", [])]

This allowed the code to resolve the package version, based on the version argument passed to the hook.

Thanks again!

@j0yu j0yu self-assigned this Jul 28, 2020
@j0yu j0yu added this to the 0.2.0 release milestone Jul 28, 2020
@j0yu
Copy link
Collaborator

j0yu commented Jul 28, 2020

Nice suggestion, I'll add it in!

@j0yu j0yu added the enhancement New feature or request label Jul 28, 2020
@j0yu j0yu mentioned this issue Jul 28, 2020
@j0yu j0yu closed this as completed in #7 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants