From 5845ce95af0c55583317cb1825ec628579873663 Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Mon, 28 Nov 2022 18:33:09 +0900 Subject: [PATCH 1/4] cruft: update template --- .cruft.json | 2 +- .pre-commit-config.yaml | 10 ++++++---- setup.cfg | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) 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..da3bdf2c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,7 @@ repos: - id: check-executables-have-shebangs - id: check-json - id: check-merge-conflict + args: ['--assume-in-merge'] - id: check-toml - id: check-yaml - id: debug-statements @@ -28,9 +29,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 +42,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 From c2485193e5d7c9267c94da764c90f50db9b1ab02 Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Mon, 28 Nov 2022 18:40:24 +0900 Subject: [PATCH 2/4] run pyupgrade --- src/scmrepo/git/backend/dulwich/credentials.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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, ) From 7921d4376474bf6096fdb091e55f1321cd7a5655 Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Mon, 28 Nov 2022 18:46:45 +0900 Subject: [PATCH 3/4] pre-commit: exclude readme from check-merge-conflicts --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da3bdf2c..67656a51 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,6 +15,7 @@ repos: - id: check-json - id: check-merge-conflict args: ['--assume-in-merge'] + exclude: "README.rst" - id: check-toml - id: check-yaml - id: debug-statements From c5cfe19f30e3e9895ebca055ca1bbab8197a085e Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Mon, 28 Nov 2022 18:48:26 +0900 Subject: [PATCH 4/4] suppress flake8 abstract warning on non-abstract methods --- src/scmrepo/git/backend/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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