mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-06-29 22:16:13 +02:00
Display warning if Python version is less than 3.7 (#994)
* Add Python version check and faulty test to confirm it's working (should fail on 3.6 build only) * Apply formatting * Fix behave Python version test * Make error message more descriptive and friendly
This commit is contained in:
parent
686fc0cfdf
commit
4ca6e3f95f
3 changed files with 32 additions and 1 deletions
15
jrnl/cli.py
15
jrnl/cli.py
|
@ -21,6 +21,7 @@
|
|||
|
||||
import argparse
|
||||
import logging
|
||||
import packaging.version
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
|
@ -29,7 +30,7 @@ import jrnl
|
|||
|
||||
from . import install, plugins, util
|
||||
from .Journal import PlainJournal, open_journal
|
||||
from .util import ERROR_COLOR, RESET_COLOR, UserAbort
|
||||
from .util import WARNING_COLOR, ERROR_COLOR, RESET_COLOR, UserAbort
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
logging.getLogger("keyring.backend").setLevel(logging.ERROR)
|
||||
|
@ -313,6 +314,18 @@ def configure_logger(debug=False):
|
|||
|
||||
|
||||
def run(manual_args=None):
|
||||
if packaging.version.parse(platform.python_version()) < packaging.version.parse(
|
||||
"3.7"
|
||||
):
|
||||
print(
|
||||
f"""{WARNING_COLOR}
|
||||
WARNING: Python versions below 3.7 will no longer be supported as of jrnl v2.5
|
||||
(the next release). You are currently on Python {platform.python_version()}. Please update to
|
||||
Python 3.7 (or higher) soon.
|
||||
{RESET_COLOR}""",
|
||||
file=sys.stderr,
|
||||
)
|
||||
|
||||
if manual_args is None:
|
||||
manual_args = sys.argv[1:]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue