Skip to content

Commit

Permalink
Fix various type issues under Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
maresb committed Nov 23, 2024
1 parent c859b6a commit 2d17f22
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions conda_lock/conda_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def _get_pkgs_dirs(
env = conda_env_override(platform)
output = subprocess.check_output(args, env=env).decode()
json_object_str = extract_json_object(output)
json_object: dict[str, Any] = json.loads(json_object_str)
pkgs_dirs_list: list[str]
json_object: Dict[str, Any] = json.loads(json_object_str)
pkgs_dirs_list: List[str]
if "pkgs_dirs" in json_object:
pkgs_dirs_list = json_object["pkgs_dirs"]
elif "package cache" in json_object:
Expand Down
6 changes: 3 additions & 3 deletions conda_lock/lockfile/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def create(
except ImportError:
return None

git_sha: str | None = None
git_user_name: str | None = None
git_user_email: str | None = None
git_sha: Optional[str] = None
git_user_name: Optional[str] = None
git_user_email: Optional[str] = None

try:
repo = git.Repo(search_parent_directories=True)
Expand Down
6 changes: 3 additions & 3 deletions conda_lock/virtual_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def to_repodata_entry(self) -> Tuple[str, Dict[str, Any]]:

class FakeRepoData(BaseModel):
base_path: pathlib.Path
packages_by_subdir: defaultdict[FakePackage, Set[str]] = Field(
default_factory=lambda: defaultdict[FakePackage, Set[str]](set)
packages_by_subdir: DefaultDict[FakePackage, Set[str]] = Field(
default_factory=lambda: defaultdict(set) # type: ignore[arg-type]
)
all_subdirs: Set[str] = {
"noarch",
Expand All @@ -60,7 +60,7 @@ class FakeRepoData(BaseModel):
"osx-arm64",
"win-64",
}
all_repodata: Dict[str, dict] = {}
all_repodata: Dict[str, Dict[str, Any]] = {}
hash: Optional[str] = None
old_env_vars: Dict[str, Optional[str]] = {}

Expand Down

0 comments on commit 2d17f22

Please sign in to comment.