Skip to content

Commit

Permalink
Add python 3.12 to workflow-ci.yml (#39)
Browse files Browse the repository at this point in the history
* Add python 3.12 to workflow-ci.yml

* Update pre-commit deps

* Disable flake8-mock

* Add link to issue

* Add pyupgrade
  • Loading branch information
yakimka authored Oct 28, 2023
1 parent ef78f37 commit 1ed6de9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/workflow-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11']
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand Down
21 changes: 13 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ repos:
hooks:
- id: check-github-workflows
- id: check-dependabot
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
Expand All @@ -27,23 +32,23 @@ repos:
hooks:
- id: flake8
additional_dependencies: [
# "flake8-assertive~=2.1.0"
# "flake8-future-annotations~=1.1.0",
"dlint~=0.14.1",
"flake8-async~=22.11.14",
"flake8-bandit~=4.1.1",
"flake8-bugbear~=23.7.10",
"flake8-bugbear~=23.9.16",
"flake8-comprehensions~=3.14.0",
"flake8-eradicate~=1.5.0",
"flake8-mock==0.4",
# disabled because on 3.12 gets confused by E902 errors
# https://github.com/zupo/flake8-mock/issues/16
# "flake8-mock==0.4",
"flake8-noqa~=1.3.2",
"flake8-pie~=0.16.0",
"flake8-pytest-style~=1.7.2",
"flake8-self~=0.2.2",
"flake8-simplify~=0.20.0",
"flake8-type-checking~=2.4.1",
"flake8-typing-imports~=1.14.0",
"flake8-simplify~=0.21.0",
"flake8-type-checking~=2.5.1",
"flake8-typing-imports~=1.15.0",
"flake8-unused-arguments~=0.0.13",
"flake8-warnings~=0.4.0",
"flake8-warnings~=0.4.1",
"pep8-naming~=0.13.3",
]
7 changes: 6 additions & 1 deletion difflume/diffapp/differ.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
from __future__ import annotations

import difflib
from collections import deque
from dataclasses import dataclass
from enum import Enum
from typing import Generator, Iterable
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from collections.abc import Generator, Iterable


class DiffType(Enum):
Expand Down
2 changes: 1 addition & 1 deletion difflume/diffapp/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self, path: str) -> None:

async def _read_text(self) -> str:
try:
with open(self._path, "r") as f:
with open(self._path) as f:
return f.read()
except (OSError, UnicodeDecodeError) as e:
raise ReadError(f"Could not read file {self._path}") from e
Expand Down
4 changes: 3 additions & 1 deletion difflume/tui/modals.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import annotations

import os
from typing import TYPE_CHECKING, Generator
from typing import TYPE_CHECKING

from textual.binding import Binding
from textual.containers import Center, ScrollableContainer
Expand All @@ -21,6 +21,8 @@
from difflume.diffapp.modules import CouchDBModule, FSModule, URLModule

if TYPE_CHECKING:
from collections.abc import Generator

from textual import events
from textual.app import ComposeResult

Expand Down
4 changes: 3 additions & 1 deletion difflume/tui/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import contextlib
import os
from pathlib import Path
from typing import TYPE_CHECKING, Generator, Literal
from typing import TYPE_CHECKING, Literal

from rich.highlighter import Highlighter, JSONHighlighter, ReprHighlighter
from rich.style import Style
Expand All @@ -21,6 +21,8 @@
from difflume.tui.widgets import LeftPanel, MiddlePanel, Panel, PanelType, RightPanel

if TYPE_CHECKING:
from collections.abc import Generator

from textual.app import ComposeResult


Expand Down
4 changes: 3 additions & 1 deletion difflume/tui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import annotations

from enum import Enum
from typing import TYPE_CHECKING, Generator
from typing import TYPE_CHECKING

from textual.binding import Binding
from textual.containers import VerticalScroll
Expand All @@ -13,6 +13,8 @@
from difflume.tui import modals

if TYPE_CHECKING:
from collections.abc import Generator

from rich.console import RenderableType
from textual.app import ComposeResult

Expand Down

0 comments on commit 1ed6de9

Please sign in to comment.