File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -34,10 +34,13 @@ def session_install_uv(
3434    install_docs : bool  =  False ,
3535) ->  None :
3636    """Install root project into the session's virtual environment using uv.""" 
37-     env  =  {
38-         "UV_PROJECT_ENVIRONMENT" : session .virtualenv .location ,
39-         "UV_PYTHON" : sys .executable ,  # Override any external UV_PYTHON setting 
40-     }
37+     env  =  os .environ .copy ()
38+     env .update (
39+         {
40+             "UV_PROJECT_ENVIRONMENT" : session .virtualenv .location ,
41+             "UV_PYTHON" : sys .executable ,  # Force uv to use the session's interpreter 
42+         }
43+     )
4144
4245    args  =  ["uv" , "sync" , "--frozen" ]
4346    if  not  install_project :
@@ -52,7 +55,13 @@ def session_install_uv(
5255
5356def  session_install_uv_package (session : Session , packages : list [str ]) ->  None :
5457    """Install packages into the session's virtual environment using uv lockfile.""" 
55-     env  =  {"UV_PROJECT_ENVIRONMENT" : session .virtualenv .location }
58+     env  =  os .environ .copy ()
59+     env .update (
60+         {
61+             "UV_PROJECT_ENVIRONMENT" : session .virtualenv .location ,
62+             "UV_PYTHON" : sys .executable ,
63+         }
64+     )
5665
5766    # Export requirements.txt to session temp dir using uv with locked dependencies 
5867    requirements_tmp  =  str (Path (session .create_tmp ()) /  "requirements.txt" )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments