Repository: Azure/iotedgedev (language: python)

Issue:
Update azure-cli-core
<!-- Describe the feature you'd like. -->

The azure-cli-core dependency is currently pinned to version 2.25.0, which is quite old, so it should be updated. Apart from that, if we want to install azure-cli when within the same environment using pip, the same version of azure-cli needs to be used. This version has a dependency on an old library that makes use of a deprecated feature of `setuptools`. Therefore, if we want to set the development environment this way, we need to use an old `setuptools` library.

azure-cli-core should be pinned to version 2.34.1.  Please note >=2.35.0 cannot be used as this version is not compatible with the `docker` dependency, since `docker` requires websocket-client==0.56.0 and azure-cli-core>=2.35.0 requires websocket-client==1.31.1.


Discussion / hints:
I'd like to join this

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8acd19ec..4cbf2c6b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,9 @@
 # Changelog
 All notable changes to this project since 0.82.0 will be documented in this file.
 
+## [3.3.5] - 2022-05-17
+- Update azure-cli-core
+
 ## [3.3.4] - 2022-03-24
 - Lock simulator version at 0.14.14
 - Update Wiki and dev container to reflect changes about the simulator
diff --git a/requirements.txt b/requirements.txt
index 4ce9fa96..5006029e 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,10 +3,10 @@ docker==5.0.3
 python-dotenv==0.19.0
 requests==2.25.1
 fstrings==0.1.0
-msrestazure==0.4.34
+msrestazure==0.6.4
 iotedgehubdev==0.14.14
 applicationinsights==0.11.9
 commentjson==0.9.0
-azure-cli-core==2.25.0
+azure-cli-core==2.34.1
 pypiwin32==219; sys_platform == 'win32' and python_version < '3.6'
 pypiwin32==223; sys_platform == 'win32' and python_version >= '3.6'
diff --git a/setup.py b/setup.py
index 40566c32..ab3ece7c 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,9 @@
     'python-dotenv',
     'requests >= 2.20.0, <= 2.25.1',
     'fstrings',
-    'azure-cli-core >= 2.25.0',
+    # Note >=2.35.0 cannot be used as is not compatible with the docker dependency;
+    # docker requires websocket-client==0.56.0 and azure-cli-core>=2.35.0 requires websocket-client==1.31.1.
+    'azure-cli-core >= 2.34.1, < 2.35.0',
     'iotedgehubdev == 0.14.14',
     'applicationinsights == 0.11.9',
     'commentjson == 0.9.0',


Test patch:
diff --git a/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json b/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json
index efaddd20..f052fd73 100644
--- a/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json
+++ b/tests/assets/test_solution_shared_lib/layered_deployment.flattened_props.template.json
@@ -2,19 +2,53 @@
     "content": {
         "modulesContent": {
             "$edgeAgent": {
-                "properties.desired.modules.sample_module": {
-                    "version": "1.0",
-                    "type": "docker",
-                    "status": "running",
-                    "restartPolicy": "always",
-                    "settings": {
-                        "image": "${MODULES.sample_module}",
-                        "createOptions": {}
+                "properties.desired": {
+                    "schemaVersion": "${EDGEAGENT_SCHEMA_VERSION}",
+                    "runtime": {
+                      "type": "docker",
+                      "settings": {
+                        "minDockerVersion": "v1.25",
+                        "loggingOptions": "",
+                        "registryCredentials": {}
+                      }
+                    },
+                    "modules": {
+                        "sample_module": {
+                            "version": "1.0",
+                            "type": "docker",
+                            "status": "running",
+                            "restartPolicy": "always",
+                            "settings": {
+                                "image": "${MODULES.sample_module}",
+                                "createOptions": {}
+                            }
+                        }
+                    },
+                    "systemModules": {
+                        "edgeAgent": {
+                            "type": "docker",
+                            "settings": {
+                                "image": "mcr.microsoft.com/azureiotedge-agent:${EDGE_RUNTIME_VERSION}"
+                            }
+                        },
+                        "edgeHub": {
+                            "type": "docker",
+                            "status": "running",
+                            "settings": {
+                                "image": "mcr.microsoft.com/azureiotedge-hub:${EDGE_RUNTIME_VERSION}"
+                            },
+                            "restartPolicy": "always"
+                        }
                     }
                 }
             },
             "$edgeHub": {
-                "properties.desired.routes.upstream": "FROM /messages/* INTO $upstream"
+                "properties.desired": {
+                    "schemaVersion": "${EDGEHUB_SCHEMA_VERSION}",
+                    "routes": {
+                        "route": "FROM /messages/* INTO $upstream"
+                    }
+                }
             }
         }
     }
diff --git a/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json b/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json
deleted file mode 100644
index 158f68ed..00000000
--- a/tests/assets/test_solution_shared_lib/layered_deployment.no_modules.template.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-  "content": {
-    "modulesContent": {
-      "$edgeAgent": {},
-      "exampleModule": {
-        "properties.desired": {
-          "foo": "bar-${EDGE_RUNTIME_VERSION}"
-        }
-      }
-    }
-  }
-}
\ No newline at end of file
diff --git a/tests/test_iotedgedev_iothub_deploy.py b/tests/test_iotedgedev_iothub_deploy.py
index f4a8c157..42325e2f 100644
--- a/tests/test_iotedgedev_iothub_deploy.py
+++ b/tests/test_iotedgedev_iothub_deploy.py
@@ -21,7 +21,6 @@
     "config, manifest",
     [
         ("layered_deployment.flattened_props.template.json", "layered_deployment.flattened_props.json"),
-        ("layered_deployment.no_modules.template.json", "layered_deployment.no_modules.json"),
         ("deployment.template.json", f"deployment.{get_platform_type()}.json")
     ]
 )
diff --git a/tests/test_iotedgedev_solution.py b/tests/test_iotedgedev_solution.py
index bba2f132..1ae8f8a8 100644
--- a/tests/test_iotedgedev_solution.py
+++ b/tests/test_iotedgedev_solution.py
@@ -371,7 +371,6 @@ def test_validate_deployment_template_and_manifest_success():
             result = runner_invoke(['genconfig', '-f', deployment_file_name])
 
         assert "ERROR" not in result.output
-        assert "Deployment manifest schema validation passed" in result.output
         assert "Warning: Deployment manifest schema validation failed" not in result.output
         assert "Validation for all createOptions passed" in result.output
         assert "Warning: Errors found during createOptions validation" not in result.output
diff --git a/tests/test_iotedgedev_solution_build.py b/tests/test_iotedgedev_solution_build.py
index c2c3add8..95679a99 100644
--- a/tests/test_iotedgedev_solution_build.py
+++ b/tests/test_iotedgedev_solution_build.py
@@ -69,25 +69,6 @@ def test_solution_build_and_push_with_layered_deployment():
     assert 'ERROR' not in result.output
 
 
-def test_solution_build_and_push_with_layered_deployment_no_modules():
-    # Arrange
-    os.chdir(test_solution_shared_lib_dir)
-    new_config_deployment_path = os.path.join(test_solution_shared_lib_dir, 'config', 'layered_deployment.no_modules.json')
-
-    # Act
-    result = runner_invoke(['build', '--push', '-f', "layered_deployment.no_modules.template.json", '-P', get_platform_type()])
-
-    # Assert
-
-    with open(new_config_deployment_path, "r") as f:
-        content = json.load(f)
-
-    set_property = content["content"]["modulesContent"]["exampleModule"]["properties.desired"]["foo"]
-
-    assert 'ERROR' not in result.output
-    assert 'bar-1.2' == set_property
-
-
 def test_solution_build_and_push_with_platform():
     os.chdir(test_solution_shared_lib_dir)