-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Modify the Maya integrated submitter to use job params
BREAKING CHANGES: - This updates the implementation to use the updated adaptor support interface - Rearrange the high level directory structure so that there is a clean submitter_plugin directory that holds the plugin structure Maya needs, and a clean usage of the deadline namespace package for the bulk of the adaptor and submitter code. - Change the Camera selection options to "All Cameras" and the specific cameras that are applicable to the current layer selection. Other Notes: - Enabled the camera options, whether to render a layer's cameras in one task or multiple tasks - The Job Parameters now include MayaSceneFile, Frames, RezPackages, and more. - Remove the pattern "import <module> as _<module>" - Place the Maya integrated submitter into the deadline namespace package - Add a developer option that can submit wheels along with the job to override the adaptor, and describe how to enable it in DEVELOPMENT.md. - Change the default max failed tasks limit from 100 to 20, to reflect discussion on the topic. - Remove tests that are mocking Maya in favour of adding an in-Maya job bundle test mechanism. - Update the icon in Maya, it was failing to load. - Reworked shelf.py to use maya.mel and maya.cmds instead of pymel. Also removed the custom shelf.json and code that parsed and interpreted it. The code is much simpler to create the shelf and buttons directly. - Removed all usage of pymel from the submitter and adaptor. - Removed all unit tests that were based on mocking pymel calls. - Update the install_builder xml as best I can without running it. Signed-off-by: Mark Wiebe <markw@amazon.com>
- Loading branch information
Showing
110 changed files
with
4,446 additions
and
3,951 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ __pycache__/ | |
.vscode | ||
*_version.py | ||
dependency_bundle | ||
/wheels/ | ||
**/test_job_bundle/ | ||
**/test-job-bundle-results.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
import os | ||
import shutil | ||
|
||
from hatchling.builders.hooks.plugin.interface import BuildHookInterface | ||
from typing import Any | ||
|
||
|
||
class HatchCustomBuildHook(BuildHookInterface): | ||
""" | ||
This class implements Hatch's [custom build hook] (https://hatch.pypa.io/1.6/plugins/build-hook/custom/) | ||
for a copy_version_py operation that copies the _version.py file generated by the hatch-vcs build hook into | ||
specified destination directories. See the `[[tool.hatch.build.hooks.custom]]` section in `pyproject.toml`. | ||
""" | ||
|
||
def _validate_config(self): | ||
if sorted(self.config) != ["copy_version_py", "path"] or list( | ||
self.config["copy_version_py"] | ||
) != ["destinations"]: | ||
raise RuntimeError( | ||
"Configuration of the custom build hook must be like { 'copy_version_py': {'destinations': ['path1', ...]}}." | ||
+ f" Received:\n{self.config}" | ||
) | ||
|
||
def initialize(self, version: str, build_data: dict[str, Any]) -> None: | ||
self._validate_config() | ||
|
||
for destination in self.config["copy_version_py"]["destinations"]: | ||
print(f"Copying _version.py to {destination}") | ||
shutil.copy( | ||
os.path.join(self.root, "_version.py"), | ||
os.path.join(self.root, destination), | ||
) | ||
|
||
def clean(self, versions: list[str]) -> None: | ||
self._validate_config() | ||
|
||
cleaned_count = 0 | ||
for destination in self.config["copy_version_py"]["destinations"]: | ||
print(f"Cleaning _version.py from {destination}") | ||
clean_path = os.path.join(self.root, destination, "_version.py") | ||
try: | ||
os.remove(clean_path) | ||
cleaned_count += 1 | ||
except FileNotFoundError: | ||
pass | ||
print(f"Cleaned {cleaned_count} items") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
job_bundle_output_tests/cube/expected_job_bundle/asset_references.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
assetReferences: | ||
inputs: | ||
directories: [] | ||
filenames: | ||
- /normalized/job/bundle/dir/cube.ma | ||
- /normalized/job/bundle/dir/deadline_logo_48x48.png | ||
- /normalized/job/bundle/dir/scene_file_to_reference.mb | ||
outputs: | ||
directories: | ||
- /normalized/job/bundle/dir/images |
Oops, something went wrong.