File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ def _runtime_env_repo_impl(rctx):
1010            op  =  "GetPyenvVersionFile" ,
1111            arguments  =  [pyenv , "version-file" ],
1212        ).stdout .strip ()
13+ 
14+         # When pyenv is used, the version file is what decided the 
15+         # version used. Watch it so we compute the correct value if the 
16+         # user changes it. 
1317        rctx .watch (pyenv_version_file )
1418
1519    version  =  repo_utils .execute_checked (
@@ -24,7 +28,9 @@ def _runtime_env_repo_impl(rctx):
2428        environment  =  {
2529            # Prevent the user's current shell from influencing the result. 
2630            # This envvar won't be present when a test is run. 
27-             "PYENV_VERSION" : None ,
31+             # NOTE: This should be None, but Bazel 7 doesn't support None 
32+             # values. Thankfully, pyenv treats empty string the same as missing. 
33+             "PYENV_VERSION" : "" ,
2834        },
2935    ).stdout .strip ()
3036    rctx .file ("info.bzl" , "PYTHON_VERSION = '{}'\n " .format (version ))
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments