From b2d2a8ed98cad8300408c93ecf37db8829f9d5ad Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:18:03 +0000 Subject: [PATCH 1/5] Update dependencies and fix failing unit tests Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> --- pyproject.toml | 4 ++-- .../unit/MayaAdaptor/test_adaptor.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 19d0f34..0ebbf29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,8 +10,8 @@ license = "" requires-python = ">=3.7" dependencies = [ - "deadline == 0.28.*", - "openjd == 0.10.*", + "deadline == 0.29.*", + "openjd-adaptor-runtime == 0.3.*", ] [project.scripts] diff --git a/test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py b/test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py index 8ccddfd..ff4c5da 100644 --- a/test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py +++ b/test/deadline_adaptor_for_maya/unit/MayaAdaptor/test_adaptor.py @@ -225,7 +225,7 @@ def test_populate_action_queue_test_mapping( mock_actions_queue.__len__.return_value = 0 mock_rules.return_value = [ PathMappingRule( - source_os="linux", + source_path_format="posix", source_path="/source", destination_os="linux", destination_path="/destination", @@ -277,7 +277,7 @@ def test_arnold_pathmapping_called( mock_actions_queue.__len__.return_value = 0 mock_rules.return_value = [ PathMappingRule( - source_os="linux", + source_path_format="posix", source_path="/source", destination_os="linux", destination_path="/destination", @@ -324,19 +324,19 @@ def test_arnold_pathmapping( # GIVEN mock_rules.return_value = [ PathMappingRule( - source_os="linux", + source_path_format="posix", source_path="/source", destination_os="linux", destination_path="/destination", ), PathMappingRule( - source_os="windows", + source_path_format="windows", source_path="C:\\source", destination_os="linux", destination_path="/destination", ), PathMappingRule( - source_os="mac os", + source_path_format="posix", source_path="/mac_source", destination_os="linux", destination_path="/destination", From 095b5dbd3e4ba6006725195268f7dfea9afce8fd Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Fri, 6 Oct 2023 00:44:06 +0000 Subject: [PATCH 2/5] Fix failing unit test Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> --- .../plugins/test_deadline_submitter_maya.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py b/test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py index d89c5e8..fef6867 100644 --- a/test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py +++ b/test/deadline_submitter_for_maya/unit/plugins/test_deadline_submitter_maya.py @@ -87,19 +87,19 @@ def __eq__(self, other: Any) -> bool: ) def test_initialize_plugin_exc(mock_reload: Mock, mock_confirm_dialog: Mock) -> None: # GIVEN - - # WHEN - with pytest.raises(Exception) as exc_info: - DeadlineCloudForMaya.initializePlugin(Mock()) - - # THEN - assert exc_info.value is mock_reload.side_effect - mock_confirm_dialog.assert_called_once_with( - title="Deadline Cloud For Maya Plugin Failed To Load", - message=( - "Encountered the following exception while loading the Deadline Cloud Submitter:\n" - f"{str(exc_info.value)}" - ), - button="OK", - defaultButton="OK", - ) + with patch.object(DeadlineCloudForMaya, "_first_initialization", False): + # WHEN + with pytest.raises(Exception) as exc_info: + DeadlineCloudForMaya.initializePlugin(Mock()) + + # THEN + assert exc_info.value is mock_reload.side_effect + mock_confirm_dialog.assert_called_once_with( + title="Deadline Cloud For Maya Plugin Failed To Load", + message=( + "Encountered the following exception while loading the Deadline Cloud Submitter:\n" + f"{str(exc_info.value)}" + ), + button="OK", + defaultButton="OK", + ) From 38133dfd6c0087e56dfdba52cb2169998fda00aa Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:05:42 +0000 Subject: [PATCH 3/5] Update wheel references Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> --- scripts/build_wheels.sh | 6 ++++-- src/deadline/maya_submitter/maya_render_submitter.py | 8 ++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/build_wheels.sh b/scripts/build_wheels.sh index 779b03f..4e85f83 100644 --- a/scripts/build_wheels.sh +++ b/scripts/build_wheels.sh @@ -8,7 +8,9 @@ if [ ! -d wheels ]; then fi rm -f wheels/* -for dir in ../openjobio ../deadline-cloud ../deadline-cloud-for-maya; do +for dir in ../openjd-adaptor-runtime-for-python ../deadline-cloud ../deadline-cloud-for-maya; do echo "Building $dir..." - python -m build --wheel --outdir ./wheels --skip-dependency-check $dir + cd $dir + hatch build + mv dist/*.whl ../deadline-cloud-for-maya/wheels/ done diff --git a/src/deadline/maya_submitter/maya_render_submitter.py b/src/deadline/maya_submitter/maya_render_submitter.py index e25c955..ba8581c 100644 --- a/src/deadline/maya_submitter/maya_render_submitter.py +++ b/src/deadline/maya_submitter/maya_render_submitter.py @@ -273,10 +273,14 @@ def _get_job_template( wheels_path_package_names = { path.split("-", 1)[0] for path in os.listdir(wheels_path) if path.endswith(".whl") } - if wheels_path_package_names != {"openjd", "deadline", "deadline_cloud_for_maya"}: + if wheels_path_package_names != { + "openjd_adaptor_runtime", + "deadline", + "deadline_cloud_for_maya", + }: raise RuntimeError( "The Developer Option 'Include Adaptor Wheels' is enabled, but the wheels directory contains the wrong wheels:\n" - + "Expected: openjd, deadline, and deadline_cloud_for_maya\n" + + "Expected: openjd_adaptor_runtime, deadline, and deadline_cloud_for_maya\n" + f"Actual: {wheels_path_package_names}" ) From 13dcd77f07a7f5b9e7ef47cf396babd47b0744d1 Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Fri, 6 Oct 2023 20:05:54 +0000 Subject: [PATCH 4/5] Update documentation Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> --- DEVELOPMENT.md | 47 +++++++++++++++++++++-------------------------- README.md | 31 +++++++++++++++++++------------ 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index dd376d6..900d152 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -16,53 +16,48 @@ All of the testing and development dependencies are in the `setup.cfg` and are m `./build.sh` will build and run `pytest`. -# Submitter Development Workflow +## Submitter Development Workflow WARNING: This workflow installs additional Python packages into your Maya's python distribution. -1. Create a development location within which to do your git checkouts. For example `~/deadline-clients`. - Clone packages from this directory with commands like - `git clone git@github.com:casillas2/deadline-cloud-for-maya.git`. You'll also want the `deadline-cloud` and `openjd` repos. +1. Create a development location within which to do your git checkouts. For example `~/deadline-clients`. Clone packages from this directory with commands like `git clone git@github.com:casillas2/deadline-cloud-for-maya.git`. You'll also want the `deadline-cloud` and `openjd` repos. 2. Switch to your Maya directory, like `cd "C:\Program Files\Autodesk\Maya2023"`. -3. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\deadline-cloud` to install the Amazon Deadline Cloud Client - Library in edit mode. -4. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\openjd` to install the Open Job Description - Library in edit mode. -5. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\deadline-cloud-for-maya` to install the Maya Submtiter - in edit mode. +3. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\deadline-cloud` to install the Amazon Deadline Cloud Client Library in edit mode. +4. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\openjd-adaptor-runtime-for-python` to install the Open Job Description Adaptor Runtime Library in edit mode. +5. Run `.\mayapy -m pip install -e C:\Users\\deadline-clients\deadline-cloud-for-maya` to install the Maya submitter in edit mode. 6. Edit (create if missing) your `~/Documents/maya/2023/Maya.env` file, and add the following lines to it: - ``` + + ```bash DEADLINE_ENABLE_DEVELOPER_OPTIONS=true MAYA_MODULE_PATH=C:\Users\\deadline-clients\deadline-cloud-for-maya\maya_submitter_plugin ``` + The developer options add a shelf TEST button you can use to run the tests from the `job_bundle_output_tests` directory. -7. Run Maya. Go to Windows > Settings/Preferences > Plug-In Manager and you will find that - `DeadlineCloudForMaya.py` is available as a plugin. Check the checkbox to have Maya load - the plugin and create the Deadline tray for you. Click the icon on the tray to open the submitter. +7. Run Maya. Go to Windows > Settings/Preferences > Plug-In Manager and you will find that `DeadlineCloudForMaya.py` is available as a plugin. Check the checkbox to have Maya load the plugin and create the Deadline tray for you. Click the icon on the tray to open the submitter. -# Application Interface Adaptor Development Workflow +## Application Interface Adaptor Development Workflow You can work on the adaptor alongside your submitter development workflow using a Deadline Cloud -farm that uses a service-managed fleet. You'll need to perform the following steps to subsititute +farm that uses a service-managed fleet. You'll need to perform the following steps to substitute your build of the adaptor for the one in the service. -1. Use the development location from the Submitter Development Workflow. - Make sure you're running Maya with `set DEADLINE_ENABLE_DEVELOPER_OPTIONS=true` enabled. -2. Build wheels for `openjd`, `deadline` and `deadline-cloud-for-maya`, place them in a "wheels" - folder in `deadline-cloud-for-maya`. A script is provided to do this, just execute from `deadline-cloud-for-maya`: - ``` +1. Use the development location from the Submitter Development Workflow. Make sure you're running Maya with `set DEADLINE_ENABLE_DEVELOPER_OPTIONS=true` enabled. +2. Build wheels for `openjd_adaptor_runtime`, `deadline` and `deadline_cloud_for_maya`, place them in a "wheels" folder in `deadline-cloud-for-maya`. A script is provided to do this, just execute from `deadline-cloud-for-maya`: + + ```bash # If you don't have the build package installed already $ pip install build ... $ ./scripts/build_wheels.sh ``` + Wheels should have been generated in the "wheels" folder: - ``` + + ```bash $ ls ./wheels deadline_cloud_for_maya--py3-none-any.whl deadline--py3-none-any.whl - openjd--py3-none-any.whl + openjd_adaptor_runtime--py3-none-any.whl ``` -3. Open the Maya integrated submitter, and in the Job-Specific Settings tab, enable the option 'Include Adaptor Wheels'. This - option is only visible when the environment variable `DEADLINE_ENABLE_DEVELOPER_OPTIONS` is set to `true`. - Then submit your test job. + +3. Open the Maya integrated submitter, and in the Job-Specific Settings tab, enable the option 'Include Adaptor Wheels'. This option is only visible when the environment variable `DEADLINE_ENABLE_DEVELOPER_OPTIONS` is set to `true`. Then submit your test job. diff --git a/README.md b/README.md index fbc85a9..42503ab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## Amazon Deadline Cloud for Maya +# Amazon Deadline Cloud for Maya This package has two active branches: @@ -9,30 +9,37 @@ The deadline.maya_adaptor package is an adaptor that renders maya scenes through ## Development -# Build / Test / Release +See [DEVELOPMENT](DEVELOPMENT.md) for more information. -## Build the package. -``` +## Build / Test / Release + +### Build the package + +```bash hatch build ``` -## Run tests -``` +### Run tests + +```bash hatch run test ``` -## Run linting -``` +### Run linting + +```bash hatch run lint ``` -## Run formating -``` +### Run formatting + +```bash hatch run fmt ``` -## Run tests for all supported Python versions. -``` +### Run tests for all supported Python versions + +```bash hatch run all:test ``` From 2e3c8cef46178e50431dd56f9624b985cac3e8db Mon Sep 17 00:00:00 2001 From: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> Date: Tue, 10 Oct 2023 18:26:33 +0000 Subject: [PATCH 5/5] Update to latest deadline version Signed-off-by: Alex Gerveshi <15710060+agerveshi@users.noreply.github.com> --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0ebbf29..8db3b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ license = "" requires-python = ">=3.7" dependencies = [ - "deadline == 0.29.*", + "deadline == 0.30.*", "openjd-adaptor-runtime == 0.3.*", ]