diff --git a/.github/workflows/syntax.yml b/.github/workflows/syntax.yml index 74085540..43e1a3b7 100644 --- a/.github/workflows/syntax.yml +++ b/.github/workflows/syntax.yml @@ -22,7 +22,7 @@ jobs: - name: Checkout Source uses: actions/checkout@v4 - name: Install flake8 - run: pip install flake8 + run: pip install flake8 flake8-pep585 - name: Syntax Check run: | flake8 --version diff --git a/novelwriter/core/buildsettings.py b/novelwriter/core/buildsettings.py index 4081b6dc..c2a04375 100644 --- a/novelwriter/core/buildsettings.py +++ b/novelwriter/core/buildsettings.py @@ -29,8 +29,8 @@ import uuid import logging from enum import Enum -from typing import Iterable from pathlib import Path +from collections.abc import Iterable from PyQt5.QtCore import QT_TRANSLATE_NOOP, QCoreApplication diff --git a/novelwriter/core/coretools.py b/novelwriter/core/coretools.py index bba2ca64..c77b99fb 100644 --- a/novelwriter/core/coretools.py +++ b/novelwriter/core/coretools.py @@ -29,10 +29,10 @@ from __future__ import annotations import shutil import logging -from typing import Iterable from pathlib import Path from functools import partial from zipfile import ZipFile, is_zipfile +from collections.abc import Iterable from PyQt5.QtCore import QCoreApplication diff --git a/novelwriter/core/docbuild.py b/novelwriter/core/docbuild.py index 35bfa79d..449052df 100644 --- a/novelwriter/core/docbuild.py +++ b/novelwriter/core/docbuild.py @@ -25,8 +25,8 @@ from __future__ import annotations import logging -from typing import Iterable from pathlib import Path +from collections.abc import Iterable from PyQt5.QtGui import QFont, QFontInfo diff --git a/novelwriter/core/index.py b/novelwriter/core/index.py index a5a781a9..d5f035aa 100644 --- a/novelwriter/core/index.py +++ b/novelwriter/core/index.py @@ -32,8 +32,9 @@ import json import logging from time import time -from typing import TYPE_CHECKING, ItemsView, Iterable, Iterator +from typing import TYPE_CHECKING from pathlib import Path +from collections.abc import ItemsView, Iterable, Iterator from novelwriter import SHARED from novelwriter.enum import nwComment, nwItemClass, nwItemType, nwItemLayout diff --git a/novelwriter/core/project.py b/novelwriter/core/project.py index a2504fd7..dbe09be8 100644 --- a/novelwriter/core/project.py +++ b/novelwriter/core/project.py @@ -28,9 +28,10 @@ import logging from enum import Enum from time import time -from typing import TYPE_CHECKING, Iterator +from typing import TYPE_CHECKING from pathlib import Path from functools import partial +from collections.abc import Iterator from PyQt5.QtCore import QCoreApplication diff --git a/novelwriter/core/sessions.py b/novelwriter/core/sessions.py index 75a5ae9d..62e88960 100644 --- a/novelwriter/core/sessions.py +++ b/novelwriter/core/sessions.py @@ -27,8 +27,9 @@ import json import logging from time import time -from typing import TYPE_CHECKING, Iterator +from typing import TYPE_CHECKING from pathlib import Path +from collections.abc import Iterator from novelwriter.error import logException from novelwriter.common import formatTimeStamp diff --git a/novelwriter/core/spellcheck.py b/novelwriter/core/spellcheck.py index 5aa46f18..51804d83 100644 --- a/novelwriter/core/spellcheck.py +++ b/novelwriter/core/spellcheck.py @@ -27,8 +27,9 @@ from __future__ import annotations import json import logging -from typing import TYPE_CHECKING, Iterator +from typing import TYPE_CHECKING from pathlib import Path +from collections.abc import Iterator from PyQt5.QtCore import QLocale diff --git a/novelwriter/core/status.py b/novelwriter/core/status.py index ec42e8fd..71a48747 100644 --- a/novelwriter/core/status.py +++ b/novelwriter/core/status.py @@ -27,7 +27,8 @@ from __future__ import annotations import random import logging -from typing import TYPE_CHECKING, ItemsView, Iterator, KeysView, Literal, ValuesView +from typing import TYPE_CHECKING, Literal +from collections.abc import ItemsView, Iterator, KeysView, ValuesView from PyQt5.QtGui import QIcon, QPainter, QPainterPath, QPixmap, QColor from PyQt5.QtCore import QRectF, Qt diff --git a/novelwriter/core/toodt.py b/novelwriter/core/toodt.py index 97201f70..e4bf57c5 100644 --- a/novelwriter/core/toodt.py +++ b/novelwriter/core/toodt.py @@ -29,11 +29,11 @@ from __future__ import annotations import logging import xml.etree.ElementTree as ET -from typing import Sequence from hashlib import sha256 from pathlib import Path from zipfile import ZipFile from datetime import datetime +from collections.abc import Sequence from novelwriter import __version__ from novelwriter.common import xmlIndent diff --git a/novelwriter/core/tree.py b/novelwriter/core/tree.py index e5aceb60..3624bb9d 100644 --- a/novelwriter/core/tree.py +++ b/novelwriter/core/tree.py @@ -26,8 +26,9 @@ from __future__ import annotations import random import logging -from typing import TYPE_CHECKING, Iterator, Literal, overload +from typing import TYPE_CHECKING, Literal, overload from pathlib import Path +from collections.abc import Iterator from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType from novelwriter.error import logException