From 5de29baa053ca7db4557721327a9824bc60c4cce Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Mon, 30 Aug 2021 17:39:47 +0200 Subject: [PATCH 1/3] Add CI checks for Python 3.5 compatibility --- .github/workflows/check-python-compatibility.yml | 13 +++++++++++++ .gitlab-ci.yml | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 .github/workflows/check-python-compatibility.yml diff --git a/.github/workflows/check-python-compatibility.yml b/.github/workflows/check-python-compatibility.yml new file mode 100644 index 0000000..a381ffc --- /dev/null +++ b/.github/workflows/check-python-compatibility.yml @@ -0,0 +1,13 @@ +name: pre-commit checks +on: [push, pull_request] +jobs: + pre-commit: + runs-on: ubuntu-latest + container: sciapp/python-testing:latest-ubuntu-20.04 + steps: + - name: Check out repository code + uses: actions/checkout@v2 + - name: Setup simple-term-menu on Python 3.5 + run: python3.5 -m pip install . + - name: Run a simple-term-menu check on Python 3.5 + run: python3.5 -m simple_term_menu --version diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e5097c..ab705fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,6 +20,13 @@ pre-commit: exit 1; } +check-python-compatibility:py35: + stage: check + image: sciapp/python-testing:latest-ubuntu-20.04 + script: + - python3.5 -m pip install . + - python3.5 -m simple_term_menu --version + build-linux-executable: stage: build image: centos:7 From 79ba7639cdea046e7a920c4c05cb5988fc1a7a45 Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Mon, 30 Aug 2021 17:40:27 +0200 Subject: [PATCH 2/3] Fix the Python 3.5 compatibility In Python 3.5, a trailing comma after a keyword-only parameter list definition is not allowed. This commit removes that comma and reconfigures black to use a code style which is compatible with Python 3.5. --- .pre-commit-config.yaml | 5 ++++- simple_term_menu.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df37e1c..049ccb7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,7 +73,10 @@ repos: rev: 21.6b0 hooks: - id: black - args: ['--line-length=120'] + args: [ + '--line-length=120', + '--target-version=py35', + ] - repo: https://github.com/PyCQA/isort rev: 5.9.2 hooks: diff --git a/simple_term_menu.py b/simple_term_menu.py index 3b0201a..fb0854e 100755 --- a/simple_term_menu.py +++ b/simple_term_menu.py @@ -562,7 +562,7 @@ def __init__( status_bar: Optional[Union[str, Iterable[str], Callable[[str], str]]] = None, status_bar_below_preview: bool = DEFAULT_STATUS_BAR_BELOW_PREVIEW, status_bar_style: Optional[Iterable[str]] = DEFAULT_STATUS_BAR_STYLE, - title: Optional[Union[str, Iterable[str]]] = None, + title: Optional[Union[str, Iterable[str]]] = None ): def extract_shortcuts_menu_entries_and_preview_arguments( entries: Iterable[str], From 395618f8cb7a5f9d03bce10feb61e1300c5213ec Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Mon, 30 Aug 2021 17:47:05 +0200 Subject: [PATCH 3/3] Increase the version number to v1.4.1 --- simple_term_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_term_menu.py b/simple_term_menu.py index fb0854e..dac3899 100755 --- a/simple_term_menu.py +++ b/simple_term_menu.py @@ -43,7 +43,7 @@ __email__ = "i.meyer@fz-juelich.de" __copyright__ = "Copyright © 2021 Forschungszentrum Jülich GmbH. All rights reserved." __license__ = "MIT" -__version_info__ = (1, 4, 0) +__version_info__ = (1, 4, 1) __version__ = ".".join(map(str, __version_info__))