@@ -31,6 +31,7 @@ def _load_schedule(self):
3131 schedule .setdefault ("active_nightly_builds" , [])
3232 schedule .setdefault ("patch_base_versions" , [])
3333 schedule .setdefault ("minor_base_versions" , [])
34+ schedule .setdefault ("major_base_versions" , [])
3435 return schedule_var , schedule
3536 except Exception as e :
3637 print (f"Error loading schedule from GitHub: { e } " )
@@ -72,10 +73,11 @@ def remove_version(self, version):
7273
7374 if version_obj .patch == 0 : # Handling minor version
7475 # Remove previous minor version from minor_base_versions
75- self .current_schedule ["minor_base_versions" ] = [
76- v for v in self .current_schedule ["minor_base_versions" ]
77- if not v .startswith (f"{ version_obj .major } .{ version_obj .minor - 1 } " )
78- ]
76+ if version_obj .minor > 0 :
77+ self .current_schedule ["minor_base_versions" ] = [
78+ v for v in self .current_schedule ["minor_base_versions" ]
79+ if not v .startswith (f"{ version_obj .major } .{ version_obj .minor - 1 } " )
80+ ]
7981 else : # Handling patch version
8082 prev_version = str (version_obj .replace (patch = version_obj .patch - 1 ))
8183 if prev_version in self .current_schedule ["patch_base_versions" ]:
@@ -99,11 +101,12 @@ def add_next_versions(self, version):
99101 self .current_schedule ["active_nightly_builds" ].extend (next_versions )
100102 self .current_schedule ["patch_base_versions" ].append (version )
101103 self .current_schedule ["minor_base_versions" ].append (version )
102- prev_version = str (version_obj .replace (minor = version_obj .minor - 1 ))
103- # If 2.2.0 is released, and 2.1.0 was the base for 3.0.0, now set 2.2.0 as base
104- if prev_version in self .current_schedule ["major_base_versions" ]:
105- self .current_schedule ["major_base_versions" ].remove (prev_version )
106- self .current_schedule ["major_base_versions" ].append (version )
104+ if version_obj .minor > 0 :
105+ prev_version = str (version_obj .replace (minor = version_obj .minor - 1 ))
106+ # If 2.2.0 is released, and 2.1.0 was the base for 3.0.0, now set 2.2.0 as base
107+ if prev_version in self .current_schedule ["major_base_versions" ]:
108+ self .current_schedule ["major_base_versions" ].remove (prev_version )
109+ self .current_schedule ["major_base_versions" ].append (version )
107110 else : # Handling patch version
108111 self .current_schedule ["active_nightly_builds" ].extend (next_versions )
109112 self .current_schedule ["patch_base_versions" ].append (version )
0 commit comments