From 4db4384eb6e5af3c2d6485b0fab5e9c0c9930bb5 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 23:27:50 +0200 Subject: [PATCH 1/4] Split linting into two steps --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e368d104..c5d9f746f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,8 @@ jobs: python -m pip install --upgrade pip pip install -r test-requirements.txt - - name: Run linting - run: | - flake8 - flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py + - name: Lint implementation + run: flake8 + + - name: Lint tests + run: flake8 --config=.flake8-tests src/test_typing.py python2/test_typing.py typing_extensions/src_py2/test_typing_extensions.py typing_extensions/src_py3/test_typing_extensions.py From 07b0e961e182099af77c2d636e29764a9273b1cb Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 23:30:12 +0200 Subject: [PATCH 2/4] Fix an overly long line --- .github/workflows/ci.yml | 2 +- typing_extensions/src_py3/typing_extensions.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5d9f746f..1f9d361bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: pytest $PYTHONPATH linting: - name: Run linting + name: Lint runs-on: ubuntu-latest diff --git a/typing_extensions/src_py3/typing_extensions.py b/typing_extensions/src_py3/typing_extensions.py index f36bba372..184da0ad1 100644 --- a/typing_extensions/src_py3/typing_extensions.py +++ b/typing_extensions/src_py3/typing_extensions.py @@ -2428,7 +2428,9 @@ def __call__(self, *args, **kwargs): @property def __parameters__(self): - return tuple(tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec))) + return tuple( + tp for tp in self.__args__ if isinstance(tp, (TypeVar, ParamSpec)) + ) if not PEP_560: # Only required in 3.6 and lower. From b97907b70656a95603793131bb5c865bfcb60912 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 23:32:48 +0200 Subject: [PATCH 3/4] Run linter with Python 3.9 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f9d361bf..e09f89d41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 - name: Install dependencies run: | From 8e192ba8d9b748e5d57f43f53755d4b11dcb3c8e Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 30 Aug 2021 23:41:42 +0200 Subject: [PATCH 4/4] Ignore more errors in test linting --- .flake8-tests | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.flake8-tests b/.flake8-tests index 06b437dbf..6af938e1f 100644 --- a/.flake8-tests +++ b/.flake8-tests @@ -11,17 +11,25 @@ builtins = basestring, unicode max-line-length = 100 ignore = # temporary ignores until we sort it out + B017, + E302, + E303, E306, + E501, E701, E704, + F722, F811, + F821, + F841, + W503, # irrelevant plugins B3, - DW12 + DW12, # consistency with mypy W504 exclude = # This config is NOT for the main module. - setup.py + setup.py, python2/typing.py, src/typing.py