Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixops
base: 53a9af0021bf
Choose a base ref
...
head repository: NixOS/nixops
compare: 61dac233ae69
Choose a head ref
  • 3 commits
  • 3 files changed
  • 2 contributors

Commits on Mar 2, 2020

  1. logger.py

    doshitan authored and grahamc committed Mar 2, 2020
    Copy the full SHA
    b892584 View commit details
    Browse the repository at this point in the history
  2. ssh_util.py

    doshitan authored and grahamc committed Mar 2, 2020
    Copy the full SHA
    b7fc5e1 View commit details
    Browse the repository at this point in the history
  3. ssh_util: typed run_command wrapper

    An alternative implementation of #1238 from GitHub user doshitan which
    used Literal[...] as a sort of dependent type:
    
        +    @overload
        +    def run_command(
        +        self,
        +        command: Command,
        +        flags: List[str] = ...,
        +        timeout: Optional[int] = ...,
        +        logged: bool = ...,
        +        allow_ssh_args: bool = ...,
        +        user: Optional[str] = ...,
        +        *,
        +        capture_stdout: Literal[False],
        +        **kwargs: Any
        +    ) -> int:
        +        ...
        +
        +    @overload
        +    def run_command(
        +        self,
        +        command: Command,
        +        flags: List[str] = ...,
        +        timeout: Optional[int] = ...,
        +        logged: bool = ...,
        +        allow_ssh_args: bool = ...,
        +        user: Optional[str] = ...,
        +        *,
        +        capture_stdout: Literal[True],
        +        **kwargs: Any
        +    ) -> str:
        +        ...
        +
        +    @overload
        +    def run_command(
        +        self,
        +        command: Command,
        +        flags: List[str] = [],
        +        timeout: Optional[int] = None,
        +        logged: bool = True,
        +        allow_ssh_args: bool = False,
        +        user: Optional[str] = None,
        +        **kwargs: Any
        +    ) -> Union[str, int]:
        +        ...
    
    however, I think this option is much simpler and improves the API.
    Possibly in the future we will add this more complex type.
    grahamc committed Mar 2, 2020
    Copy the full SHA
    61dac23 View commit details
    Browse the repository at this point in the history