diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index eff2d991..4b55f253 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -111,7 +111,7 @@ jobs: id: pypi-version-getter run: | pypi_version="$(find dist/jrnl-*.tar.gz | sed -r 's!dist/jrnl-(.*)\.tar\.gz!\1!')" - echo "::set-output name=pypi_version::$pypi_version" + echo "pypi_version=$pypi_version" >> "$GITHUB_OUTPUT" release_homebrew: if: ${{ github.event.inputs.include_brew == 'true' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f1de227b..d4d86379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,6 @@ - Fix bug where changelog is always slightly out of date on release tags [\#1631](https://github.com/jrnl-org/jrnl/pull/1631) ([wren](https://github.com/wren)) -**Documentation:** - -- Document that editors must be blocking processes [\#1624](https://github.com/jrnl-org/jrnl/pull/1624) ([micahellison](https://github.com/micahellison)) - ## [v3.3](https://pypi.org/project/jrnl/v3.3/) (2022-10-29) [Full Changelog](https://github.com/jrnl-org/jrnl/compare/v3.3-beta2...v3.3) diff --git a/jrnl/exception.py b/jrnl/exception.py index 86140cd9..b4ec2be8 100644 --- a/jrnl/exception.py +++ b/jrnl/exception.py @@ -1,14 +1,18 @@ # Copyright © 2012-2022 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html -from jrnl.messages import Message +from typing import TYPE_CHECKING + from jrnl.output import print_msg +if TYPE_CHECKING: + from jrnl.messages import Message + class JrnlException(Exception): """Common exceptions raised by jrnl.""" - def __init__(self, *messages: Message): + def __init__(self, *messages: "Message"): self.messages = messages def print(self) -> None: diff --git a/jrnl/messages/Message.py b/jrnl/messages/Message.py index e4d6176a..bb193f5f 100644 --- a/jrnl/messages/Message.py +++ b/jrnl/messages/Message.py @@ -1,14 +1,17 @@ # Copyright © 2012-2022 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html +from typing import TYPE_CHECKING from typing import Mapping from typing import NamedTuple from jrnl.messages.MsgStyle import MsgStyle -from jrnl.messages.MsgText import MsgText + +if TYPE_CHECKING: + from jrnl.messages.MsgText import MsgText class Message(NamedTuple): - text: MsgText + text: "MsgText" style: MsgStyle = MsgStyle.NORMAL params: Mapping = {} diff --git a/jrnl/override.py b/jrnl/override.py index 4b6506ee..75a400b9 100644 --- a/jrnl/override.py +++ b/jrnl/override.py @@ -1,14 +1,15 @@ # Copyright © 2012-2022 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html - -from argparse import Namespace +from typing import TYPE_CHECKING from jrnl.config import make_yaml_valid_dict from jrnl.config import update_config +if TYPE_CHECKING: + from argparse import Namespace # import logging -def apply_overrides(args: Namespace, base_config: dict) -> dict: +def apply_overrides(args: "Namespace", base_config: dict) -> dict: """Unpack CLI provided overrides into the configuration tree. :param overrides: List of configuration key-value pairs collected from the CLI diff --git a/poetry.lock b/poetry.lock index 443485f0..8c5b6616 100644 --- a/poetry.lock +++ b/poetry.lock @@ -120,6 +120,14 @@ python-versions = ">=3.6.0" [package.extras] unicode-backport = ["unicodedata2"] +[[package]] +name = "classify-imports" +version = "4.2.0" +description = "Utilities for refactoring imports in python-like syntax." +category = "dev" +optional = false +python-versions = ">=3.7" + [[package]] name = "click" version = "8.1.3" @@ -277,6 +285,18 @@ python-versions = ">=3.6.1" astor = ">=0.1" flake8 = ">=3.7" +[[package]] +name = "flake8-type-checking" +version = "2.2.0" +description = "A flake8 plugin for managing type-checking imports & forward references" +category = "dev" +optional = false +python-versions = ">=3.8" + +[package.dependencies] +classify-imports = "*" +flake8 = "*" + [[package]] name = "flakeheaven" version = "3.2.0" @@ -1178,7 +1198,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "1.1" python-versions = ">=3.10.0, <3.13" -content-hash = "c3b4e0ffbe4c6920b1fb773b7eee9d92a78b4950e33b18c94595f3558ec9322e" +content-hash = "d386601320306164cb6332391f68aca47c114da7cad2dfa273d1fcb70824db16" [metadata.files] ansiwrap = [ @@ -1307,6 +1327,10 @@ charset-normalizer = [ {file = "charset-normalizer-2.1.0.tar.gz", hash = "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"}, {file = "charset_normalizer-2.1.0-py3-none-any.whl", hash = "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5"}, ] +classify-imports = [ + {file = "classify_imports-4.2.0-py2.py3-none-any.whl", hash = "sha256:dbbc264b70a470ed8c6c95976a11dfb8b7f63df44ed1af87328bbed2663f5161"}, + {file = "classify_imports-4.2.0.tar.gz", hash = "sha256:7abfb7ea92149b29d046bd34573d247ba6e68cc28100c801eba4af17964fc40e"}, +] click = [ {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, @@ -1383,6 +1407,10 @@ flake8-simplify = [ {file = "flake8_simplify-0.19.3-py3-none-any.whl", hash = "sha256:1057320e9312d75849541fee822900d27bcad05b2405edc84713affee635629e"}, {file = "flake8_simplify-0.19.3.tar.gz", hash = "sha256:2fb083bf5142a98d9c9554755cf2f56f8926eb4a33eae30c0809041b1546879e"}, ] +flake8-type-checking = [ + {file = "flake8_type_checking-2.2.0-py3-none-any.whl", hash = "sha256:c7d9d7adc6cd635a5a1a7859e5e0140f4f8f1705982a22db45872dd9acd49753"}, + {file = "flake8_type_checking-2.2.0.tar.gz", hash = "sha256:f7972fc9102f3f632ace1f4b1c5c20b900b8b7b529f04bb6c1fe0a11801e9658"}, +] flakeheaven = [ {file = "flakeheaven-3.2.0-py3-none-any.whl", hash = "sha256:ec5a508c3db64d73128b65cb2a5a2c0a2d9f2e4b435e9fa2bcc03bf0df86da79"}, {file = "flakeheaven-3.2.0.tar.gz", hash = "sha256:225333d7bf309079f19a2c5f02d427fc7558a0d0c065944de88041ca94f5525c"}, diff --git a/pyproject.toml b/pyproject.toml index 0a5a66e2..ecd5f015 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ black = { version = ">=21.5b2", allow-prereleases = true } flakeheaven = ">=3.0" flake8-black = ">=0.3.3" flake8-isort = ">=5.0.0" +flake8-type-checking = ">=2.2.0" flake8-simplify = ">=0.19" ipdb = "*" isort = ">=5.10"