From 84da4ef2a6536dd610d4826a36d051363b4e7784 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 30 May 2022 15:45:03 -0500 Subject: [PATCH 1/2] Revert "! squash more mypy" This reverts commit 078ebb72895c23b213a3322c0626b8264e221cb6. --- libvcs/_internal/run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvcs/_internal/run.py b/libvcs/_internal/run.py index be0248d7c..b83280ba8 100644 --- a/libvcs/_internal/run.py +++ b/libvcs/_internal/run.py @@ -178,7 +178,7 @@ def run( shell: bool = False, cwd: Optional[StrOrBytesPath] = None, env: Optional[_ENV] = None, - universal_newlines: bool = False, + universal_newlines: Optional[bool] = None, startupinfo: Optional[Any] = None, creationflags: int = 0, restore_signals: bool = True, @@ -262,7 +262,7 @@ def progress_cb(output, timestamp): umask=umask, ) - all_output: list[str] = [] + all_output = [] code = None line = None while code is None: @@ -270,7 +270,7 @@ def progress_cb(output, timestamp): # output = console_to_str(proc.stdout.readline()) # all_output.append(output) - if callback and callable(callback) and proc.stderr is not None: + if callback and callable(callback): line = console_to_str(proc.stderr.read(128)) if line: callback(output=line, timestamp=datetime.datetime.now()) From 26ef6e8d1f35d0d207d90647f9c31af8f51eee92 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Mon, 30 May 2022 15:31:04 -0500 Subject: [PATCH 2/2] ci(tests): Add tsuyoshicho/action-mypy See also: https://github.com/tsuyoshicho/action-mypy --- .github/workflows/tests.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5f222e0b1..6c3200e0e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,7 +42,17 @@ jobs: run: poetry run flake8 - name: Lint with mypy - run: poetry run mypy . + uses: tsuyoshicho/action-mypy@v3 + with: + github_token: ${{ secrets.github_token }} + # Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review]. + reporter: github-pr-review + # Change reporter level if you need. + # GitHub Status Check won't become failure with warning. + # level: warning + # Change the current directory to run mypy command. + # mypy command reads setup.cfg or other settings file in this path. + # workdir: . - name: Print python versions run: |