@@ -188,17 +188,17 @@ async def _parse_remote_repo(source: str, token: str | None = None) -> Ingestion
188188 # Try to resolve a tag
189189 parsed .tag = await _configure_branch_or_tag (
190190 remaining_parts ,
191- url ,
192- configure = "tags" ,
191+ url = url ,
192+ ref_type = "tags" ,
193193 token = token ,
194194 )
195195
196196 # If no tag found, try to resolve a branch
197197 if not parsed .tag :
198198 parsed .branch = await _configure_branch_or_tag (
199199 remaining_parts ,
200- url ,
201- configure = "branches" ,
200+ url = url ,
201+ ref_type = "branches" ,
202202 token = token ,
203203 )
204204
@@ -211,8 +211,9 @@ async def _parse_remote_repo(source: str, token: str | None = None) -> Ingestion
211211
212212async def _configure_branch_or_tag (
213213 remaining_parts : list [str ],
214+ * ,
214215 url : str ,
215- configure : str ,
216+ ref_type : str ,
216217 token : str | None = None ,
217218) -> str | None :
218219 """Configure the branch or tag based on the remaining parts of the URL.
@@ -223,8 +224,8 @@ async def _configure_branch_or_tag(
223224 The remaining parts of the URL path.
224225 url : str
225226 The URL of the repository.
226- configure : str
227- The type of object to configure. Can be "branches" or "tags".
227+ ref_type : str
228+ The type of reference to configure. Can be "branches" or "tags".
228229 token : str | None
229230 GitHub personal access token (PAT) for accessing private repositories.
230231
@@ -236,21 +237,21 @@ async def _configure_branch_or_tag(
236237 Raises
237238 ------
238239 ValueError
239- If the ``configure `` parameter is not "branches" or "tags".
240+ If the ``ref_type `` parameter is not "branches" or "tags".
240241
241242 """
242- if configure not in ("branches" , "tags" ):
243- msg = f"Invalid configure type: { configure } "
243+ if ref_type not in ("branches" , "tags" ):
244+ msg = f"Invalid reference type: { ref_type } "
244245 raise ValueError (msg )
245246
246- to_fetch = "tags" if configure == "tags" else "branches"
247+ _ref_type = "tags" if ref_type == "tags" else "branches"
247248
248249 try :
249250 # Fetch the list of branches or tags from the remote repository
250- branches_or_tags : list [str ] = await fetch_remote_branches_or_tags (url , fetch = to_fetch , token = token )
251+ branches_or_tags : list [str ] = await fetch_remote_branches_or_tags (url , ref_type = _ref_type , token = token )
251252 except RuntimeError as exc :
252253 # If remote discovery fails, we optimistically treat the first path segment as the branch/tag.
253- msg = f"Warning: Failed to fetch { to_fetch } : { exc } "
254+ msg = f"Warning: Failed to fetch { _ref_type } : { exc } "
254255 warnings .warn (msg , RuntimeWarning , stacklevel = 2 )
255256 return remaining_parts .pop (0 ) if remaining_parts else None
256257
0 commit comments