-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #425 from nix-community/more-ruff-lints
More ruff lints
- Loading branch information
Showing
9 changed files
with
85 additions
and
69 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pytest_plugins = [ | ||
"direnv_project", | ||
"root", | ||
"tests.direnv_project", | ||
"tests.root", | ||
] |
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 |
---|---|---|
@@ -1,23 +1,27 @@ | ||
import logging | ||
import shlex | ||
import subprocess | ||
from pathlib import Path | ||
from typing import IO, Any, List, Optional, Union | ||
from typing import IO, Any | ||
|
||
_FILE = Union[None, int, IO[Any]] | ||
_DIR = Union[None, Path, str] | ||
_FILE = None | int | IO[Any] | ||
_DIR = None | Path | str | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def run( | ||
cmd: List[str], | ||
cmd: list[str], | ||
text: bool = True, | ||
check: bool = True, | ||
cwd: _DIR = None, | ||
stderr: _FILE = None, | ||
stdout: _FILE = None, | ||
env: Optional[dict[str, str]] = None, | ||
env: dict[str, str] | None = None, | ||
) -> subprocess.CompletedProcess: | ||
if cwd is not None: | ||
print(f"cd {cwd}") | ||
print("$ " + " ".join(cmd)) | ||
log.debug(f"cd {cwd}") | ||
log.debug(f"$ {shlex.join(cmd)}") | ||
return subprocess.run( | ||
cmd, text=text, check=check, cwd=cwd, stderr=stderr, stdout=stdout, env=env | ||
) |
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