Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting #875

Merged
merged 4 commits into from Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions .flake8-tests
Expand Up @@ -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
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -44,7 +44,7 @@ jobs:
pytest $PYTHONPATH

linting:
name: Run linting
name: Lint

runs-on: ubuntu-latest

Expand All @@ -54,14 +54,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9

- name: Install dependencies
run: |
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
4 changes: 3 additions & 1 deletion typing_extensions/src_py3/typing_extensions.py
Expand Up @@ -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.
Expand Down