-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move NoOpBuildEnvironment to its own file
This makes it easier to notice that there's three implementations of build environment management.
- Loading branch information
Showing
3 changed files
with
34 additions
and
33 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,32 @@ | ||
from types import TracebackType | ||
from typing import List, Optional, Type, Iterable | ||
|
||
from pip._internal.build_env import BuildEnvironment | ||
from pip._internal.index.package_finder import PackageFinder | ||
|
||
|
||
class NoOpBuildEnvironment(BuildEnvironment): | ||
"""A build environment that does nothing.""" | ||
|
||
lib_dirs: List[str] = [] | ||
|
||
def __enter__(self) -> None: | ||
return | ||
|
||
def __exit__( | ||
self, | ||
exc_type: Optional[Type[BaseException]], | ||
exc_val: Optional[BaseException], | ||
exc_tb: Optional[TracebackType], | ||
) -> None: | ||
return | ||
|
||
def install_requirements( | ||
self, | ||
finder: "PackageFinder", | ||
requirements: Iterable[str], | ||
prefix_as_string: str, | ||
*, | ||
kind: str, | ||
) -> None: | ||
raise NotImplementedError("This should never get called.") |