-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This introduces a new general option --unstable-feature that can be used to opt into "preview" features in pip not enabled by default. Currently the only available feature is "resolver". A stub resolver interface (which would fail on invocation) is provided to respond to the flag. The --unstable-feature option is hidden from --help since the resolver does not yet work. This suppression should be removed when we release the resolver for general/public testing.
- Loading branch information
Showing
6 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING | ||
|
||
if MYPY_CHECK_RUNNING: | ||
from typing import Callable, List | ||
from pip._internal.req.req_install import InstallRequirement | ||
from pip._internal.req.req_set import RequirementSet | ||
|
||
InstallRequirementProvider = Callable[ | ||
[str, InstallRequirement], InstallRequirement | ||
] | ||
|
||
|
||
class BaseResolver(object): | ||
def resolve(self, root_reqs, check_supported_wheels): | ||
# type: (List[InstallRequirement], bool) -> RequirementSet | ||
raise NotImplementedError() | ||
|
||
def get_installation_order(self, req_set): | ||
# type: (RequirementSet) -> List[InstallRequirement] | ||
raise NotImplementedError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from pip._internal.resolution.base import BaseResolver | ||
from pip._internal.utils.typing import MYPY_CHECK_RUNNING | ||
|
||
if MYPY_CHECK_RUNNING: | ||
from typing import List, Optional, Tuple | ||
|
||
from pip._internal.index.package_finder import PackageFinder | ||
from pip._internal.operations.prepare import RequirementPreparer | ||
from pip._internal.req.req_install import InstallRequirement | ||
from pip._internal.req.req_set import RequirementSet | ||
from pip._internal.resolution.base import InstallRequirementProvider | ||
|
||
|
||
class Resolver(BaseResolver): | ||
def __init__( | ||
self, | ||
preparer, # type: RequirementPreparer | ||
finder, # type: PackageFinder | ||
make_install_req, # type: InstallRequirementProvider | ||
use_user_site, # type: bool | ||
ignore_dependencies, # type: bool | ||
ignore_installed, # type: bool | ||
ignore_requires_python, # type: bool | ||
force_reinstall, # type: bool | ||
upgrade_strategy, # type: str | ||
py_version_info=None, # type: Optional[Tuple[int, ...]] | ||
): | ||
super(Resolver, self).__init__() | ||
|
||
def resolve(self, root_reqs, check_supported_wheels): | ||
# type: (List[InstallRequirement], bool) -> RequirementSet | ||
raise NotImplementedError() | ||
|
||
def get_installation_order(self, req_set): | ||
# type: (RequirementSet) -> List[InstallRequirement] | ||
raise NotImplementedError() |