@@ -102,7 +102,7 @@ def current_branch() -> str:
102102 branch = execute (["git" , "branch" , "--show-current" ]).strip ()
103103 if branch :
104104 return branch
105- fail ("Couldn't find current branch, please don't" " be in 'detached' state when running this." )
105+ fail ("Couldn't find current branch, please don't be in 'detached' state when running this." )
106106
107107
108108def on_main_branch () -> bool :
@@ -238,17 +238,13 @@ def main():
238238 "--test-pypi" ,
239239 "-T" ,
240240 action = "store_const" ,
241- const = "test " ,
242- dest = "repository " ,
241+ const = "testpypi " ,
242+ dest = "index " ,
243243 help = "upload to TestPyPI" ,
244244 )
245245 group .add_argument (
246- "--repository" ,
247- help = "repository (package index) name or URL to upload the package to" ,
248- )
249- group .add_argument (
250- "--repository-url" ,
251- help = "repository (package index) URL to upload the package to" ,
246+ "--index" ,
247+ help = "index name (from [[tool.uv.index]] in pyproject.toml) to upload the package to" ,
252248 )
253249 parser .add_argument ("--new-version" , help = "new version number" )
254250 args = parser .parse_args ()
@@ -289,14 +285,12 @@ def main():
289285
290286 # push package to pypi
291287 step (f"Generate and push package to { args .repository or args .repository_url or 'pypi' } " )
292- execute (["hatch " , "build" , "--clean " ], log = True )
288+ execute (["uv " , "build" ], log = True )
293289 wheel = f"dist/simpleflow-{ new_version } -py3-none-any.whl"
294290 tar_gz = f"dist/simpleflow-{ new_version } .tar.gz"
295- cmd = ["hatch" , "publish" ]
296- if args .repository :
297- cmd += ["--repo" , args .repository ]
298- elif args .repository_url :
299- cmd += ["--repo" , args .repository_url ]
291+ cmd = ["uv" , "publish" ]
292+ if args .index :
293+ cmd += ["--index" , args .index ]
300294 cmd += [wheel , tar_gz ]
301295 execute (cmd , log = True , dry_run = dry_run )
302296
0 commit comments