@@ -44,11 +44,7 @@ def get_dependencies(
4444 if exit_code != 0 :
4545 location = self ._get_pip_location (executor , working_dir )
4646 scope = "system" if self ._is_system_location (location ) else "project"
47- result : dict [str , Any ] = {"scope" : scope }
48- if scope == "project" :
49- result ["location" ] = location
50- result ["dependencies" ] = {}
51- return result
47+ return {"scope" : scope , "location" : location , "dependencies" : {}}
5248
5349 dependencies = {}
5450 for line in stdout .strip ().split ("\n " ):
@@ -65,17 +61,14 @@ def get_dependencies(
6561 scope = "system" if self ._is_system_location (location ) else "project"
6662
6763 # Build result with desired field order: scope, location, hash, dependencies
68- final_result : dict [str , Any ] = {"scope" : scope }
64+ result : dict [str , Any ] = {"scope" : scope , "location" : location }
6965
70- if scope == "project" :
71- final_result ["location" ] = location
72- # Generate location-based hash if appropriate
73- if dependencies and not skip_hash_collection :
74- final_result ["hash" ] = self ._generate_location_hash (executor , location )
66+ # Generate location-based hash if appropriate
67+ if dependencies and not skip_hash_collection :
68+ result ["hash" ] = self ._generate_location_hash (executor , location )
7569
76- final_result ["dependencies" ] = dependencies
77-
78- return final_result
70+ result ["dependencies" ] = dependencies
71+ return result
7972
8073 def _is_system_location (self , location : str ) -> bool :
8174 """Check if a location path represents a system-wide installation."""
0 commit comments