@@ -140,21 +140,22 @@ def get_type_complete_score(commands: typing.List[str], check_pytyped: bool = Fa
140
140
except subprocess .CalledProcessError :
141
141
pass # we don't fail on verifytypes, only if type completeness score worsens from main
142
142
143
- # get type completeness score from main
144
- logging .info (
145
- "Getting the type completeness score from the code in main..."
146
- )
147
- install_from_main (setup_path )
148
- score_from_main = get_type_complete_score (commands )
149
-
150
- score_from_main_rounded = round (score_from_main * 100 , 1 )
151
- score_from_current_rounded = round (score_from_current * 100 , 1 )
152
- print ("\n -----Type completeness score comparison-----\n " )
153
- print (f"Score in main: { score_from_main_rounded } %" )
154
- # Give a 5% buffer for type completeness score to decrease
155
- if score_from_current_rounded < score_from_main_rounded - 5 :
156
- print (
157
- f"\n ERROR: The type completeness score of { package_name } has significantly decreased compared to the score in main. "
158
- f"See the above output for areas to improve. See https://aka.ms/python/typing-guide for information."
143
+ if in_ci ():
144
+ # get type completeness score from main
145
+ logging .info (
146
+ "Getting the type completeness score from the code in main..."
159
147
)
160
- exit (1 )
148
+ install_from_main (setup_path )
149
+ score_from_main = get_type_complete_score (commands )
150
+
151
+ score_from_main_rounded = round (score_from_main * 100 , 1 )
152
+ score_from_current_rounded = round (score_from_current * 100 , 1 )
153
+ print ("\n -----Type completeness score comparison-----\n " )
154
+ print (f"Score in main: { score_from_main_rounded } %" )
155
+ # Give a 5% buffer for type completeness score to decrease
156
+ if score_from_current_rounded < score_from_main_rounded - 5 :
157
+ print (
158
+ f"\n ERROR: The type completeness score of { package_name } has significantly decreased compared to the score in main. "
159
+ f"See the above output for areas to improve. See https://aka.ms/python/typing-guide for information."
160
+ )
161
+ exit (1 )
0 commit comments