File tree Expand file tree Collapse file tree 2 files changed +16
-26
lines changed Expand file tree Collapse file tree 2 files changed +16
-26
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ def check(obj: dict, before_core: bool):
4949
5050    \b  
5151    Requisites before releasing llama-index-core (passing --before-core): 
52-     - current branch is not `main` 
5352    - llama-index-core/pyproject.toml is newer than the latest on PyPI 
5453
5554    Requisite after llama-index-core was published (without passing --before-core): 
@@ -60,24 +59,14 @@ def check(obj: dict, before_core: bool):
6059    repo_root  =  obj ["repo_root" ]
6160
6261    current_branch  =  _get_current_branch_name ()
63-     if  before_core :
64-         # Check current branch is NOT main 
65-         if  current_branch  ==  "main" :
66-             console .print (
67-                 "❌ You are on the `main` branch. Please create a new branch to release." ,
68-                 style = "error" ,
69-             )
70-             exit (1 )
71-         console .print ("✅ You are not on the `main` branch." )
72-     else :
73-         # Check current branch IS main 
74-         if  current_branch  !=  "main" :
75-             console .print (
76-                 "❌ To release 'llama-index' you have to checkout the `main` branch." ,
77-                 style = "error" ,
78-             )
79-             exit (1 )
80-         console .print ("✅ You are on the `main` branch." )
62+     # Check current branch IS main 
63+     if  current_branch  !=  "main" :
64+         console .print (
65+             "❌ To release 'llama-index' you have to checkout the `main` branch." ,
66+             style = "error" ,
67+         )
68+         exit (1 )
69+     console .print ("✅ You are on the `main` branch." )
8170
8271    if  before_core :
8372        # Check llama-index-core version is NEWER than PyPI 
Original file line number Diff line number Diff line change @@ -56,15 +56,14 @@ def test_get_version_from_pypi_error():
5656    ), 
5757    [ 
5858        ( 
59-             "success " , 
59+             "fail " , 
6060            "my-release-branch" , 
6161            "0.1.1" , 
6262            "0.1.1" , 
6363            "0.1.0" , 
64-             True , 
64+             False , 
6565            [ 
66-                 "✅ You are not on the `main` branch." , 
67-                 "✅ Version 0.1.1 is newer than the latest on PyPI (0.1.0)." , 
66+                 "❌ To release 'llama-index' you have to checkout the `main` branch." , 
6867            ], 
6968        ), 
7069        ( 
@@ -73,14 +72,15 @@ def test_get_version_from_pypi_error():
7372            "0.1.1" , 
7473            "0.1.1" , 
7574            "0.1.0" , 
76-             False , 
75+             True , 
7776            [ 
78-                 "❌ You are on the `main` branch. Please create a new branch to release." , 
77+                 "✅ You are on the `main` branch." , 
78+                 "✅ Version 0.1.1 is newer than the latest on PyPI (0.1.0)." , 
7979            ], 
8080        ), 
8181        ( 
8282            "not_newer" , 
83-             "my-release-branch " , 
83+             "main " , 
8484            "0.1.0" , 
8585            "0.1.0" , 
8686            "0.1.0" , 
@@ -118,6 +118,7 @@ def test_check_command(
118118
119119        if  should_pass :
120120            ctx .invoke (check , before_core = True )
121+             # print messages from console 
121122            for  msg  in  expected_message :
122123                mock_rich_console .print .assert_any_call (msg )
123124        else :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments