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:
Adam Simpkins 2020-03-02 15:37:00 -08:00 committed by Facebook Github Bot
parent 95ec8e042a
commit 3c29a20934
3 changed files with 5 additions and 4 deletions

View File

@ -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]:

View File

@ -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()