Skip to content

Commit

Permalink
Substitute version (#7)
Browse files Browse the repository at this point in the history
* Added substitution for {version}

* Updated CHANGELOG.md

* Also backported to legacy tk-config-default

* Black formatted

* Added tip and example in README.md
  • Loading branch information
j0yu authored Jul 28, 2020
1 parent ce0e411 commit 10bfa9a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.0]

### Added

- Substitute `{version}` in package request ([GitHub #4])
- Links in `CHANGELOG.md`
- CI for black formatting

### Changed

- Black formatted ([GitHub #5])


## [0.1.0]

### Added

- `rez_app_launch.py` hooks per `tk-config-default*` configurations.
- `tk-config-default*/env/**` example configurations folders.
- GitHub CI workflow to test patching/installing against
- GitHub CI workflow to test patching/installing against
official Shotgun `tk-config-default*`


[GitHub #5]: https://github.com/nerdvegas/rez-shotgun/pull/5
[GitHub #4]: https://github.com/nerdvegas/rez-shotgun/issues/4
[0.2.0]: https://github.com/nerdvegas/rez-shotgun/compare/0.1.0...0.2.0
[0.1.0]: https://github.com/nerdvegas/rez-shotgun/releases/tag/0.1.0
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ Otherwise, manually...
# rez Maya 2019
settings.tk-multi-launchapp.maya:
engine: tk-maya
versions: # Tip! These will be substituted as {version}
- 2019.0
- 2019.2
extra:
rez:
packages:
- maya-2019
- "maya-{version}" # i.e. maya-2019.0
# # Optional, additional rez packages
# - studio_maya_tools-1.2
# - show_maya_tools-dev
Expand Down Expand Up @@ -214,9 +217,12 @@ Otherwise, manually...
# -------------------------------------------------
launch_rez_maya_2019:
engine: tk-maya
versions: # Tip! These will be substituted as {version}
- 2019.0
- 2019.2
extra:
rez_packages:
- maya-2019
- "maya-{version}" # i.e. maya-2019.0
# # Optional, additional rez packages
# - studio_maya_tools-1.2
# - show_maya_tools-dev
Expand Down Expand Up @@ -252,4 +258,4 @@ Otherwise, manually...
[tk-config-default v0.18.2]: https://github.com/shotgunsoftware/tk-config-default/releases/tag/v0.18.2
[tk-config-default2]: https://github.com/shotgunsoftware/tk-config-default2
[tk-config-default2 v1.2.11]: https://github.com/shotgunsoftware/tk-config-default2/releases/tag/v1.2.11
[WWFX UK]: https://github.com/wwfxuk
[WWFX UK]: https://github.com/wwfxuk
4 changes: 3 additions & 1 deletion tk-config-default/hooks/rez_app_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def execute(self, app_path, app_args, version, **kwargs):
"KATANA_RESOURCES",
]

rez_packages = extra["rez_packages"]
rez_packages = [
request.format(version=version) for request in extra.get("packages", [])
]
context = ResolvedContext(rez_packages)

use_rez = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ def execute(self, app_path, app_args, version, **kwargs):
from rez.config import config

rez_parent_variables = rez_info.get("parent_variables", [])
rez_packages = rez_info.get("packages", [])
rez_packages = [
request.format(version=version)
for request in rez_info.get("packages", [])
]
self.logger.debug("rez parent variables: %s", rez_parent_variables)
self.logger.debug("rez packages: %s", rez_packages)

Expand Down

0 comments on commit 10bfa9a

Please sign in to comment.