Skip to content

Commit d609200

Browse files
authored
backcompat: cli (#85)
- make executable_search_paths computable if not specified and add it as `None`. - explicitly check with a test with older RPC version and removal of `executable_search_paths` param.
1 parent 1bc25b3 commit d609200

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

aws_lambda_builders/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def main(): # pylint: disable=too-many-statements
130130
params["artifacts_dir"],
131131
params["scratch_dir"],
132132
params["manifest_path"],
133-
executable_search_paths=params['executable_search_paths'],
133+
executable_search_paths=params.get('executable_search_paths', None),
134134
runtime=params["runtime"],
135135
optimizations=params["optimizations"],
136136
options=params["options"])

tests/functional/test_cli.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def tearDown(self):
5757
])
5858
def test_run_hello_workflow_with_backcompat(self, flavor, protocol_version):
5959

60-
request_json = json.dumps({
60+
request = {
6161
"jsonschema": "2.0",
6262
"id": 1234,
6363
"method": "LambdaBuilder.build",
@@ -75,11 +75,14 @@ def test_run_hello_workflow_with_backcompat(self, flavor, protocol_version):
7575
"manifest_path": "/ignored",
7676
"runtime": "ignored",
7777
"optimizations": {},
78-
"options": {},
79-
"executable_search_paths": [str(pathlib.Path(sys.executable).parent)]
78+
"options": {}
8079
}
81-
})
80+
}
81+
82+
if protocol_version == lambda_builders_protocol_version:
83+
request["executable_search_paths"] = [str(pathlib.Path(sys.executable).parent)]
8284

85+
request_json = json.dumps(request)
8386

8487
env = copy.deepcopy(os.environ)
8588
env["PYTHONPATH"] = self.python_path

0 commit comments

Comments
 (0)