33import subprocess
44
55
6- def run_command (command : str , error_message : str , success_message : str ) -> None :
6+ def run_command (command : list [ str ] , error_message : str , success_message : str ) -> None :
77 try :
8- subprocess .run (command . split () , check = True , capture_output = True , text = True )
8+ subprocess .run (command , check = True , capture_output = True , text = True )
99 print (success_message )
1010 except subprocess .CalledProcessError as e :
1111 print (f"{ error_message } : { e .stderr } " )
@@ -35,22 +35,27 @@ def release():
3535 ensure_git_is_clean ()
3636
3737 run_command (
38- f"uv version { new_version } " ,
38+ ["rm" , "-rf" , "dist" ],
39+ "Error removing dist directory" ,
40+ "✅ Removed dist directory" ,
41+ )
42+ run_command (
43+ ["uv" , "version" , new_version ],
3944 "Error updating version in pyproject.toml" ,
4045 "✅ Updated version in pyproject.toml" ,
4146 )
4247 run_command (
43- "git add pyproject.toml uv.lock" ,
48+ [ "git" , " add" , " pyproject.toml" , " uv.lock"] ,
4449 "Error adding changes" ,
4550 "✅ Updated pyproject.toml and uv.lock" ,
4651 )
4752 run_command (
48- f "git commit --no-verify -m chore: bump version to { new_version } " ,
53+ [ "git" , " commit" , " --no-verify" , "-m" , f" chore: bump version to { new_version } "] ,
4954 "Error committing version change" ,
5055 "✅ Committed version change" ,
5156 )
5257 run_command (
53- f "git tag -a { new_version } -m Release { new_version } " ,
58+ [ "git" , " tag" , "-a" , new_version , "-m" , f" Release { new_version } "] ,
5459 "Error creating git tag" ,
5560 f"✅ Created git tag: { new_version } " ,
5661 )
@@ -64,6 +69,36 @@ def release():
6469 "Error building package" ,
6570 "✅ Built package" ,
6671 )
72+ run_command (
73+ [
74+ "uv" ,
75+ "run" ,
76+ "--isolated" ,
77+ "--no-project" ,
78+ "-p" ,
79+ "3.13" ,
80+ "--with" ,
81+ f"dist/mediathequeroubaix-{ new_version } -py3-none-any.whl" ,
82+ "src/mediathequeroubaix/cli_test.py" ,
83+ ],
84+ "Error running smoke test (wheel)" ,
85+ "✅ Smoke test (wheel) passed" ,
86+ )
87+ run_command (
88+ [
89+ "uv" ,
90+ "run" ,
91+ "--isolated" ,
92+ "--no-project" ,
93+ "-p" ,
94+ "3.13" ,
95+ "--with" ,
96+ f"dist/mediathequeroubaix-{ new_version } .tar.gz" ,
97+ "src/mediathequeroubaix/cli_test.py" ,
98+ ],
99+ "Error running smoke test (source distribution)" ,
100+ "✅ Smoke test (source distribution) passed" ,
101+ )
67102 run_command (
68103 ["uv" , "publish" ],
69104 "Error publishing package" ,
0 commit comments