99import shutil
1010
1111import click
12+ from click .exceptions import Exit
1213
1314
1415@click .group ()
@@ -68,8 +69,14 @@ def dependencies(upgrade: bool, all: bool):
6869 update_dependencies (dependencies ) # write the latest versions to pyproject.toml
6970 if has_uv ():
7071 click .echo ("Upgrading dependencies with uv..." )
71- subprocess .run (["uv" , "lock" ], check = True )
72- subprocess .run (["uv" , "sync" , "--all-extras" , "--all-groups" ], check = True )
72+ result = subprocess .run (["uv" , "lock" ], check = False )
73+ if result .returncode != 0 :
74+ raise Exit (result .returncode )
75+ result = subprocess .run (
76+ ["uv" , "sync" , "--all-extras" , "--all-groups" ], check = False
77+ )
78+ if result .returncode != 0 :
79+ raise Exit (result .returncode )
7380 click .echo (
7481 click .style (
7582 "✓ All dependencies upgraded successfully 🎉" , fg = "green" , bold = True
@@ -80,7 +87,7 @@ def dependencies(upgrade: bool, all: bool):
8087 "uv not found. Updated pyproject.toml only (packages not installed)."
8188 )
8289 if all :
83- subprocess .run (["ap" , "pre-commit" , "autoupdate" ], check = True )
90+ subprocess .run (["ap" , "pre-commit" , "autoupdate" ])
8491 click .echo ("All pre-commit hooks updated successfully." )
8592
8693
@@ -124,10 +131,18 @@ def website(ctx, no_backup: bool):
124131 try :
125132 click .echo ("Updating the project website template..." )
126133 node_env : NodeEnv = find_node_env ()
127- subprocess .run (
128- ["pnpx" , "degit" , website_template_repo , str (website_path )], env = node_env
134+ result = subprocess .run (
135+ ["pnpx" , "degit" , website_template_repo , str (website_path )],
136+ env = node_env ,
137+ check = False ,
138+ )
139+ if result .returncode != 0 :
140+ raise Exit (result .returncode )
141+ result = subprocess .run (
142+ ["pnpm" , "install" ], cwd = website_path , env = node_env , check = False
129143 )
130- subprocess .run (["pnpm" , "install" ], cwd = website_path , env = node_env , check = True )
144+ if result .returncode != 0 :
145+ raise Exit (result .returncode )
131146 except Exception as e :
132147 click .echo (f"✗ Error updating project website template: { e } " , err = True )
133148 if not no_backup :
0 commit comments