mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
move the process_finder CLI code to its own library
Summary: Enable pyre-strict type checking for `process_finder.py`, and split it into its own library. Reviewed By: genevievehelsel Differential Revision: D20178483 fbshipit-source-id: e6c62ca5d84c7b7e599ae00fb51df6f7e4c55a65
This commit is contained in:
parent
95ec8e042a
commit
3c29a20934
@ -11,11 +11,10 @@ from typing import Tuple
|
||||
import eden.cli.doctor as doctor
|
||||
import eden.dirstate
|
||||
from eden.cli.config import EdenCheckout
|
||||
from eden.cli.test.lib.fake_process_finder import FakeProcessFinder
|
||||
from eden.cli.test.lib.output import TestOutput
|
||||
from eden.test_support.temporary_directory import TemporaryDirectoryMixin
|
||||
|
||||
from .fake_process_finder import FakeProcessFinder
|
||||
|
||||
|
||||
class DoctorTestBase(unittest.TestCase, TemporaryDirectoryMixin):
|
||||
def create_fixer(self, dry_run: bool) -> Tuple[doctor.ProblemFixer, TestOutput]:
|
||||
|
@ -4,6 +4,8 @@
|
||||
# This software may be used and distributed according to the terms of the
|
||||
# GNU General Public License version 2.
|
||||
|
||||
# pyre-strict
|
||||
|
||||
import abc
|
||||
import logging
|
||||
import os
|
||||
@ -22,7 +24,7 @@ class ProcessInfo(NamedTuple):
|
||||
eden_dir: Optional[Path]
|
||||
|
||||
|
||||
log = logging.getLogger("eden.cli.process_finder")
|
||||
log: logging.Logger = logging.getLogger("eden.cli.process_finder")
|
||||
|
||||
|
||||
class ProcessFinder(abc.ABC):
|
||||
@ -160,7 +162,7 @@ class LinuxProcessFinder(ProcessFinder):
|
||||
yield info
|
||||
|
||||
|
||||
def new():
|
||||
def new() -> ProcessFinder:
|
||||
if platform.system() == "Linux":
|
||||
return LinuxProcessFinder()
|
||||
return NopProcessFinder()
|
||||
|
Loading…
Reference in New Issue
Block a user