2424
2525
2626@app .command ()
27- def list_dependencies (project_path : str = "" ):
28- """Checks whether a dependency needs updating.
29-
30- Args:
31- project_path: Path to the project. Defaults to the current working directory.
32- """
33- project = Project (
34- project_path = project_path ,
35- gh_pat = GH_PAT ,
36- )
27+ def list_dependencies ():
28+ """Checks whether a dependency needs updating."""
29+ project = Project (gh_pat = GH_PAT )
3730
3831 # base dependencies
3932 title = Text ("Base Dependencies" , style = "bold" )
@@ -126,20 +119,13 @@ def list_dependencies(project_path: str = ""):
126119
127120
128121@app .command ()
129- def check_dependency (
130- dependency : str ,
131- project_path : str = "" ,
132- ):
122+ def check_dependency (dependency : str ):
133123 """Checks whether a dependency needs updating.
134124
135125 Args:
136126 dependency: Name of the dependency to check.
137- project_path: Path to the project. Defaults to the current working directory.
138127 """
139- project = Project (
140- project_path = project_path ,
141- gh_pat = GH_PAT ,
142- )
128+ project = Project (gh_pat = GH_PAT )
143129
144130 try :
145131 dep = project .get_dependency (name = dependency )
@@ -170,7 +156,6 @@ def check_dependency(
170156
171157@app .command ()
172158def needs_updating (
173- project_path : str = "" ,
174159 base : bool = True ,
175160 optional_deps : bool = True ,
176161 group_deps : bool = True ,
@@ -180,7 +165,6 @@ def needs_updating(
180165 """List the dependencies that need updating.
181166
182167 Args:
183- project_path: Path to the project. Defaults to the current working directory.
184168 base: If set to True, includes the base dependencies. Defaults to True.
185169 optional_deps: If set to True, includes the optional dependencies. Defaults to
186170 True.
@@ -191,10 +175,7 @@ def needs_updating(
191175 True.
192176 """
193177 # create project object
194- project = Project (
195- project_path = project_path ,
196- gh_pat = GH_PAT ,
197- )
178+ project = Project (gh_pat = GH_PAT )
198179
199180 # fetch relevant data
200181 if base or optional_deps or group_deps :
@@ -244,7 +225,6 @@ def needs_updating(
244225
245226@app .command ()
246227def latest_versions (
247- project_path : str = "" ,
248228 base : bool = True ,
249229 optional_deps : bool = True ,
250230 group_deps : bool = True ,
@@ -254,7 +234,6 @@ def latest_versions(
254234 """List the dependencies that aren't pinned to the latest version.
255235
256236 Args:
257- project_path: Path to the project. Defaults to the current working directory.
258237 base: If set to True, includes the base dependencies. Defaults to True.
259238 optional_deps: If set to True, includes the optional dependencies. Defaults to
260239 True.
@@ -265,10 +244,7 @@ def latest_versions(
265244 True.
266245 """
267246 # create project object
268- project = Project (
269- project_path = project_path ,
270- gh_pat = GH_PAT ,
271- )
247+ project = Project (gh_pat = GH_PAT )
272248
273249 # fetch relevant data
274250 if base or optional_deps or group_deps :
@@ -320,7 +296,7 @@ def latest_versions(
320296def update (
321297 dependency : str ,
322298 version : str | None = None ,
323- project_path : str = "" ,
299+ target_branch : str = "master " ,
324300):
325301 """_summary_.
326302
@@ -329,18 +305,15 @@ def update(
329305 Args:
330306 dependency: _description_
331307 version: _description_
332- project_path : _description_
308+ target_branch : _description_
333309 """
334310 with Progress (
335311 SpinnerColumn (),
336312 TextColumn ("[progress.description]{task.description}" ),
337313 transient = True ,
338314 ) as progress :
339315 task = progress .add_task ("Creating project..." )
340- project = Project (
341- project_path = project_path ,
342- gh_pat = GH_PAT ,
343- )
316+ project = Project (gh_pat = GH_PAT )
344317
345318 # search for dependency and save old version
346319 try :
@@ -435,7 +408,7 @@ def update(
435408 "-a" ,
436409 "@me" ,
437410 "--base" ,
438- "master" ,
411+ target_branch ,
439412 "--body" ,
440413 pr_body ,
441414 "--label" ,
@@ -445,10 +418,12 @@ def update(
445418 ],
446419 )
447420
448- # re-checkout master
449- run_shell_command (["git" , "checkout" , "master" ])
421+ # re-checkout master branch
422+ run_shell_command (["git" , "checkout" , target_branch ])
450423
451- rprint (f"✅ { dep .package_name } updated! View the pull request at { pr .stdout } " )
424+ msg = f"✅ [bold]{ dep .package_name } [/bold] updated! View the pull request at"
425+ msg += f" { pr .stdout } "
426+ rprint (msg )
452427
453428
454429def main ():
0 commit comments