Skip to content

Commit

Permalink
Remove LiteralString import
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed Mar 4, 2025
1 parent c96f01f commit a891736
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
branches:
- master
paths:
- '**/*.txt'
- "**/*.txt"
- "dev_scripts/*"
- ".github/workflows/version.yml"

jobs:
Expand Down
10 changes: 5 additions & 5 deletions dev_scripts/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from concurrent.futures import ThreadPoolExecutor, as_completed
from dataclasses import dataclass
from importlib.metadata import PackageNotFoundError, distribution
from typing import Any, Callable, Dict, Iterable, List, LiteralString
from typing import Any, Callable, Dict, Iterable, List
from urllib.error import HTTPError

from dev_scripts.display import echo
Expand Down Expand Up @@ -81,14 +81,14 @@ def get_latest_version(package_name, retries=5) -> str:

def get_package_and_version(
input_string: str,
) -> Dict[str, str | LiteralString | None] | None:
) -> Dict[str, str | None] | None:
"""Parses a package specified in the requirements file to retrieve package name and version.
Args:
input_string: Input line from the requirements file.
Returns:
Dict[str, str | LiteralString | None]:
Dict[str, str | None]:
Returns key-value pairs with package name and version.
"""
if not input_string or input_string.startswith("#"):
Expand All @@ -105,14 +105,14 @@ def get_package_and_version(

def read_requirements(
filepath: str,
) -> Generator[Dict[str, str | LiteralString | None]]:
) -> Generator[Dict[str, str | None]]:
"""Reads the requirements file and yields the package information.
Args:
filepath: Takes the filepath as an argument.
Yields:
Dict[str, str | LiteralString | None]:
Dict[str, str | None]:
Returns key-value pairs with package name and version.
"""
with open(filepath) as file:
Expand Down

0 comments on commit a891736

Please sign in to comment.