|
4 | 4 |
|
5 | 5 | from pathlib import Path |
6 | 6 | from posixpath import expandvars |
7 | | -from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Tuple, Union |
| 7 | +from typing import TYPE_CHECKING, Dict, FrozenSet, List, Literal, Optional, Tuple, Union |
8 | 8 | from urllib.parse import urldefrag, urlsplit, urlunsplit |
9 | 9 |
|
10 | 10 | from clikit.api.io.flags import VERY_VERBOSE |
11 | 11 | from clikit.io import ConsoleIO, NullIO |
12 | 12 | from packaging.tags import compatible_tags, cpython_tags, mac_platforms |
13 | 13 | from packaging.version import Version |
14 | 14 |
|
| 15 | +from conda_lock._vendor.poetry.core.semver import VersionConstraint |
15 | 16 | from conda_lock.interfaces.vendored_poetry import ( |
16 | 17 | Chooser, |
17 | 18 | Env, |
@@ -280,9 +281,33 @@ def parse_pip_requirement(requirement: str) -> Optional[Dict[str, str]]: |
280 | 281 |
|
281 | 282 |
|
282 | 283 | class PoetryDependencyWithHash(PoetryDependency): |
283 | | - def __init__(self, *args, hash: Optional[str] = None, **kwargs) -> None: |
| 284 | + def __init__( |
| 285 | + self, |
| 286 | + name, # type: str |
| 287 | + constraint, # type: Union[str, VersionConstraint] |
| 288 | + optional=False, # type: bool |
| 289 | + category="main", # type: str |
| 290 | + allows_prereleases=False, # type: bool |
| 291 | + extras=None, # type: Optional[Union[List[str], FrozenSet[str]]] |
| 292 | + source_type=None, # type: Optional[str] |
| 293 | + source_url=None, # type: Optional[str] |
| 294 | + source_reference=None, # type: Optional[str] |
| 295 | + source_resolved_reference=None, # type: Optional[str] |
| 296 | + hash: Optional[str] = None, |
| 297 | + ) -> None: |
| 298 | + super().__init__( |
| 299 | + name, |
| 300 | + constraint, |
| 301 | + optional=optional, |
| 302 | + category=category, |
| 303 | + allows_prereleases=allows_prereleases, |
| 304 | + extras=extras, # type: ignore # upstream type hint is wrong |
| 305 | + source_type=source_type, |
| 306 | + source_url=source_url, |
| 307 | + source_reference=source_reference, |
| 308 | + source_resolved_reference=source_resolved_reference, |
| 309 | + ) |
284 | 310 | self.hash = hash |
285 | | - super().__init__(*args, **kwargs) |
286 | 311 |
|
287 | 312 | def get_hash_model(self) -> Optional[HashModel]: |
288 | 313 | if self.hash: |
|
0 commit comments