Skip to content

Commit

Permalink
Test mypy against Python 3.8 not 3.6
Browse files Browse the repository at this point in the history
* Fall back to lineno if end_lineno is None
  • Loading branch information
domdfcoding committed Apr 2, 2024
1 parent b2ca004 commit db801a4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
if: steps.changes.outputs.code == 'true'
uses: "actions/setup-python@v5"
with:
python-version: "3.6"
python-version: "3.8"

- name: Install dependencies 🔧
if: steps.changes.outputs.code == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
if: steps.changes.outputs.code == 'true'
uses: "actions/setup-python@v5"
with:
python-version: "3.6"
python-version: "3.8"

- name: Install dependencies 🔧
run: |
Expand Down
8 changes: 3 additions & 5 deletions flake8_dunder_all/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,10 @@ def handle_import(self, node: Union[ast.Import, ast.ImportFrom]) -> None:
:param node: The node being visited
"""

if self.use_endlineno:
if node.end_lineno > self.last_import: # type: ignore[union-attr]
self.last_import = node.end_lineno # type: ignore[union-attr]
if self.use_endlineno and node.end_lineno is not None:
self.last_import = max(self.last_import, node.end_lineno)
else:
if node.lineno > self.last_import:
self.last_import = node.lineno
self.last_import = max(self.last_import, node.lineno)

def visit_Import(self, node: ast.Import) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ autodoc_exclude_members = [
]

[tool.mypy]
python_version = "3.6"
python_version = "3.8"
namespace_packages = true
check_untyped_defs = true
warn_unused_ignores = true
Expand Down
1 change: 0 additions & 1 deletion repo_helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ primary_conda_channel: "domdfcoding"
conda_channels:
- conda-forge

python_deploy_version: 3.6
use_whey: True
sphinx_html_theme: furo
min_coverage: 100
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test =
pypy38-flake8{4,5,6,7}
pypy39-flake8{4,5,6,7}
qa = mypy, lint
cov = py36-flake84, coverage
cov = py38-flake84, coverage

[testenv]
setenv =
Expand Down Expand Up @@ -117,7 +117,7 @@ commands =
check-wheel-contents dist/

[testenv:lint]
basepython = python3.6
basepython = python3.8
changedir = {toxinidir}
ignore_errors = True
skip_install = False
Expand Down Expand Up @@ -147,15 +147,15 @@ deps =
commands = python3 -m flake8_rst_docstrings_sphinx flake8_dunder_all tests --allow-toolbox {posargs}

[testenv:perflint]
basepython = python3.6
basepython = python3.8
changedir = {toxinidir}
ignore_errors = True
skip_install = True
deps = perflint
commands = python3 -m perflint flake8_dunder_all {posargs}

[testenv:mypy]
basepython = python3.6
basepython = python3.8
ignore_errors = True
changedir = {toxinidir}
deps =
Expand All @@ -165,15 +165,15 @@ deps =
commands = mypy flake8_dunder_all tests {posargs}

[testenv:pyup]
basepython = python3.6
basepython = python3.8
skip_install = True
ignore_errors = True
changedir = {toxinidir}
deps = pyupgrade-directories
commands = pyup_dirs flake8_dunder_all tests --py36-plus --recursive

[testenv:coverage]
basepython = python3.6
basepython = python3.8
skip_install = True
ignore_errors = True
whitelist_externals = /bin/bash
Expand Down

0 comments on commit db801a4

Please sign in to comment.