4040 TimestampConverter ,
4141 WaitDetails ,
4242 WaitOptions ,
43- _is_in_var_dir ,
43+ _is_bundled ,
4444)
4545
4646
@@ -2226,14 +2226,14 @@ def test_lambda_client_initialize_client_no_endpoint(
22262226
22272227
22282228@patch (
2229- "aws_durable_execution_sdk_python.lambda_service._is_in_var_dir " ,
2229+ "aws_durable_execution_sdk_python.lambda_service._is_bundled " ,
22302230 return_value = True ,
22312231)
22322232@patch ("boto3.client" )
22332233def test_lambda_client_user_agent_runtime_bundled (
2234- mock_boto_client , _mock_is_in_var_dir , reset_lambda_client_cache
2234+ mock_boto_client , _mock_is_bundled , reset_lambda_client_cache
22352235):
2236- """user_agent_extra includes -bundled when SDK is in /var/lang/ ."""
2236+ """user_agent_extra includes -bundled when the +bundled stamp is present ."""
22372237 mock_client = Mock ()
22382238 mock_boto_client .return_value = mock_client
22392239
@@ -2243,56 +2243,53 @@ def test_lambda_client_user_agent_runtime_bundled(
22432243 config = call_args [1 ]["config" ]
22442244 assert (
22452245 config .user_agent_extra
2246- == f"aws-durable-execution-sdk-python/{ __version__ } -bundled"
2246+ == f"aws-durable-execution-sdk-python/{ __version__ . split ( '+' )[ 0 ] } -bundled"
22472247 )
22482248 assert isinstance (client , LambdaClient )
22492249
22502250
22512251@patch (
2252- "aws_durable_execution_sdk_python.lambda_service._is_in_var_dir " ,
2252+ "aws_durable_execution_sdk_python.lambda_service._is_bundled " ,
22532253 return_value = False ,
22542254)
22552255@patch ("boto3.client" )
22562256def test_lambda_client_user_agent_not_runtime_bundled (
2257- mock_boto_client , _mock_is_in_var_dir , reset_lambda_client_cache
2257+ mock_boto_client , _mock_is_bundled , reset_lambda_client_cache
22582258):
2259- """user_agent_extra omits -bundled when SDK is not in /var/lang ."""
2259+ """user_agent_extra omits -bundled when the +bundled stamp is absent ."""
22602260 mock_client = Mock ()
22612261 mock_boto_client .return_value = mock_client
22622262
22632263 client = LambdaClient .initialize_client ()
22642264
22652265 call_args = mock_boto_client .call_args
22662266 config = call_args [1 ]["config" ]
2267- assert config .user_agent_extra == f"aws-durable-execution-sdk-python/{ __version__ } "
2267+ assert (
2268+ config .user_agent_extra
2269+ == f"aws-durable-execution-sdk-python/{ __version__ .split ('+' )[0 ]} "
2270+ )
22682271 assert isinstance (client , LambdaClient )
22692272
22702273
22712274@pytest .mark .parametrize (
2272- "path ,expected" ,
2275+ "version ,expected" ,
22732276 [
2274- # Lambda bundled runtime site-packages
2275- (
2276- "/var/lang/lib/python3.13/site-packages/aws_durable_execution_sdk_python/lambda_service.py" ,
2277- True ,
2278- ),
2279- (
2280- "/var/lang/lib/python3.12/site-packages/aws_durable_execution_sdk_python/lambda_service.py" ,
2281- True ,
2282- ),
2283- # Customer deployment package
2284- ("/var/task/aws_durable_execution_sdk_python/lambda_service.py" , False ),
2285- # Lambda Layer
2286- ("/opt/python/aws_durable_execution_sdk_python/lambda_service.py" , False ),
2287- # Trailing-slash guard: /var/langsurprise must not match
2288- ("/var/langsurprise/lib/python3.13/site-packages/x.py" , False ),
2289- # Local dev
2290- ("/Users/me/project/.venv/lib/python3.12/site-packages/x.py" , False ),
2277+ # Managed-runtime stamp
2278+ ("1.7.0+bundled" , True ),
2279+ ("1.7.0.post0+bundled" , True ),
2280+ # Public PyPI installs never carry the local label
2281+ ("1.7.0" , False ),
2282+ ("1.7.0.post0" , False ),
2283+ # A different local label must not match
2284+ ("1.7.0+local" , False ),
2285+ # A label beginning with 'bundled' must not match, only the exact suffix
2286+ ("1.7.0+bundleddebug" , False ),
2287+ ("1.7.0+bundled.1" , False ),
22912288 ("" , False ),
22922289 ],
22932290)
2294- def test_is_in_var_dir ( path , expected ):
2295- assert _is_in_var_dir ( path ) is expected
2291+ def test_is_bundled ( version , expected ):
2292+ assert _is_bundled ( version ) is expected
22962293
22972294
22982295def test_lambda_client_checkpoint_with_non_none_client_token ():
0 commit comments