55# "packaging>=25.0",
66# ]
77# ///
8+ import os
89import re
910from pathlib import Path
1011
@@ -36,7 +37,9 @@ def main():
3637 upper_bound = Version (f"{ major } .{ minor + 1 } .{ 0 } " )
3738
3839 repository_root = Path (__file__ ).parent .parent
39- existing = repository_root .joinpath ("source/shared/build-backend-tabs.rst" ).read_text ()
40+ existing = repository_root .joinpath (
41+ "source/shared/build-backend-tabs.rst"
42+ ).read_text ()
4043 replacement = f'requires = ["uv_build >= { current_release } , <{ upper_bound } "]'
4144 searcher = re .compile (re .escape ('requires = ["uv_build' ) + ".*" + re .escape ('"]' ))
4245 if not searcher .search (existing ):
@@ -46,11 +49,16 @@ def main():
4649 if existing != updated :
4750 print ("Updating source/shared/build-backend-tabs.rst" )
4851 Path ("source/shared/build-backend-tabs.rst" ).write_text (updated )
49- print (f"::set-output name=version::{ current_release } " )
50- print (f"::set-output name=updated::true" )
52+ if github_output := os .environ .get ("GITHUB_OUTPUT" ):
53+ with open (github_output , "a" ) as f :
54+ f .write (f"version={ current_release } \n " )
55+ f .write (f"updated=true\n " )
5156 else :
5257 print ("Already up-to-date source/shared/build-backend-tabs.rst" )
53- print (f"::set-output name=updated::false" )
58+ if github_output := os .environ .get ("GITHUB_OUTPUT" ):
59+ with open (github_output , "a" ) as f :
60+ f .write (f"updated=false\n " )
5461
55- if __name__ == '__main__' :
62+
63+ if __name__ == "__main__" :
5664 main ()
0 commit comments