diff --git a/.cruft.json b/.cruft.json index 63d4f2f8..1bf12d87 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/iterative/py-template", - "commit": "fdce0adb4bb61a3580ea0430a24ad3ec85749a8b", + "commit": "9d27491d231f3c4eaba286d81dc838f8bbc73d37", "context": { "cookiecutter": { "project_name": "scmrepo", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 08a1c852..67656a51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,8 @@ repos: - id: check-executables-have-shebangs - id: check-json - id: check-merge-conflict + args: ['--assume-in-merge'] + exclude: "README.rst" - id: check-toml - id: check-yaml - id: debug-statements @@ -28,9 +30,10 @@ repos: - id: codespell additional_dependencies: ["tomli"] - repo: https://github.com/asottile/pyupgrade - rev: v3.0.0 + rev: v3.2.2 hooks: - id: pyupgrade + args: [--py38-plus] - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: @@ -40,9 +43,9 @@ repos: hooks: - id: flake8 additional_dependencies: - - flake8-broken-line==0.5.0 - - flake8-bugbear==22.8.23 - - flake8-comprehensions==3.10.0 + - flake8-broken-line==0.6.0 + - flake8-bugbear==22.10.27 + - flake8-comprehensions==3.10.1 - flake8-debugger==4.1.2 - flake8-string-format==0.3.0 - repo: https://github.com/pycqa/bandit diff --git a/setup.cfg b/setup.cfg index a7e5971c..ef715d17 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ install_requires= [options.extras_require] tests = - pytest==7.1.2 + pytest==7.2.0 pytest-sugar==0.9.5 pytest-cov==3.0.0 pytest-mock==3.8.2 diff --git a/src/scmrepo/git/backend/base.py b/src/scmrepo/git/backend/base.py index 6e19c1c0..635dc857 100644 --- a/src/scmrepo/git/backend/base.py +++ b/src/scmrepo/git/backend/base.py @@ -39,7 +39,7 @@ class BaseGitBackend(ABC): def __init__(self, root_dir=os.curdir, search_parent_directories=True): pass - def close(self): + def close(self): # noqa: B027 pass @abstractmethod @@ -356,7 +356,7 @@ def status( files can take some time. """ - def _reset(self) -> None: + def _reset(self) -> None: # noqa: B027 pass @abstractmethod diff --git a/src/scmrepo/git/backend/dulwich/credentials.py b/src/scmrepo/git/backend/dulwich/credentials.py index 16873e8e..de4cc2c8 100644 --- a/src/scmrepo/git/backend/dulwich/credentials.py +++ b/src/scmrepo/git/backend/dulwich/credentials.py @@ -144,7 +144,7 @@ def _prepare_command(self) -> Union[str, List[str]]: # a C git helper in GIT_EXEC_PATH git_exec_path = subprocess.check_output( # nosec B603 ("git", "--exec-path"), - universal_newlines=True, + text=True, ).strip() if shutil.which(executable, path=git_exec_path): executable = os.path.join(git_exec_path, executable) @@ -184,8 +184,7 @@ def get( res = subprocess.run( # type: ignore # nosec B603 # breaks on 3.6 cmd, check=True, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + capture_output=True, input=os.linesep.join(helper_input).encode("ascii"), **self._run_kwargs, )