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

Add Python 3.12 to CI #185

Merged
merged 5 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
MartinThoma marked this conversation as resolved.
Show resolved Hide resolved
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pre-commit run --all-files
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-byte-order-marker
Expand All @@ -17,7 +17,7 @@ repos:
# hooks:
# - id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v1.5.1
hooks:
- id: mypy
- repo: https://github.com/asottile/seed-isort-config
Expand All @@ -29,16 +29,16 @@ repos:
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.1.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==22.1.0]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Install with `pip`:
pip install flake8-simplify
```

Python 3.6 to 3.10 are supported.
Python 3.8 to 3.11 are supported.


## Usage
Expand Down
10 changes: 6 additions & 4 deletions flake8_simplify/rules/ast_for.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ def get_sim104(node: ast.For) -> List[Tuple[int, int, str]]:
return errors

parent = getattr(node, "parent", None)
while (parent
and hasattr(parent, "parent")
and parent.parent is not parent
and not isinstance(parent, ast.AsyncFunctionDef)):
while (
parent
and hasattr(parent, "parent")
and parent.parent is not parent
and not isinstance(parent, ast.AsyncFunctionDef)
):
parent = getattr(parent, "parent", None)

if isinstance(parent, ast.AsyncFunctionDef): # type: ignore
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = [
license = {text = "MIT"}
maintainers = [{name = "Martin Thoma", email = "[email protected]"}]
authors = [{name = "Martin Thoma", email = "[email protected]"}]
requires-python = ">=3.6.1"
requires-python = ">=3.8"
cclauss marked this conversation as resolved.
Show resolved Hide resolved
dependencies = [
"astor>=0.1",
"flake8>=3.7",
Expand All @@ -29,10 +29,10 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development",
"Framework :: Flake8",
]
Expand All @@ -57,7 +57,7 @@ namespaces = false

[tool.black]
line-length = 79
target-version = ['py37']
target-version = ['py38']

[tool.mutmut]
backup = "False"
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pytest-cov==3.0.0
# via -r requirements/dev.in
pytest-timeout==2.1.0
# via -r requirements/dev.in
pyyaml==6.0
pyyaml==6.0.1
# via pre-commit
requests==2.27.1
# via flit
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = lint,py36,py37,py38,py39,python3.10
envlist = lint,py38,py39,py310,py311

[testenv]
deps =
Expand Down