From e955dcc2c8a91dcae95ec2115d05ef0499c88ca2 Mon Sep 17 00:00:00 2001 From: Joongi Kim Date: Sat, 9 Dec 2023 22:25:33 +0900 Subject: [PATCH 1/6] Make it working with newer Pythons by accepting potential new kwargs --- aioconsole/execute.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aioconsole/execute.py b/aioconsole/execute.py index 0caecd1..c9ca50c 100644 --- a/aioconsole/execute.py +++ b/aioconsole/execute.py @@ -99,7 +99,9 @@ def get_non_indented_lines(source): pass -def compile_for_aexec(source, filename, mode, dont_imply_dedent=False, local={}): +def compile_for_aexec( + source, filename, mode, dont_imply_dedent=False, local={}, **kwargs +): """Return a list of (coroutine object, abstract base tree).""" flags = ast.PyCF_ONLY_AST if dont_imply_dedent: From b87ad659af685181aec2b3128260273ab212f72c Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Sat, 9 Dec 2023 17:46:13 +0100 Subject: [PATCH 2/6] Add python 3.12 to the CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73929cb..aa478bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7", "pypy-3.8"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.7", "pypy-3.8"] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} From 03935a620a069c5b99cf96bfee184718ccadfe9b Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Sat, 9 Dec 2023 17:47:14 +0100 Subject: [PATCH 3/6] Run quality with python 3.11 --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa478bc..c6fd71f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,8 @@ jobs: steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 + with: + python-version: '3.11' - uses: pre-commit/action@v2.0.0 Tests: From ec9551616788213811dbedace06c7069ed7eb4f2 Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Sat, 9 Dec 2023 17:53:23 +0100 Subject: [PATCH 4/6] Install setuptools for python 3.12 --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6fd71f..4445107 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,9 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install setuptools + run: pip install -U setuptools + if: ${{ matrix.python-version == '3.12' }} - name: Install test requirements run: pip install -r test-requirements.txt - name: Run tests From a30f018947783f9a72ce6c46faa1662a09853d4c Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Sat, 9 Dec 2023 17:57:58 +0100 Subject: [PATCH 5/6] Deprecate python 3.7 --- .github/workflows/ci.yml | 2 +- setup.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4445107..7f78e5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.7", "pypy-3.8"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9"] env: OS: ${{ matrix.os }} PYTHON: ${{ matrix.python-version }} diff --git a/setup.py b/setup.py index defb930..30db0a5 100644 --- a/setup.py +++ b/setup.py @@ -10,10 +10,11 @@ CLASSIFIERS = """\ Programming Language :: Python Programming Language :: Python :: 3 -Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 +Programming Language :: Python :: 3.11 +Programming Language :: Python :: 3.12 Programming Language :: Python :: 3 :: Only """.splitlines() @@ -30,7 +31,7 @@ "pytest-repeat", ], license="GPLv3", - python_requires=">=3.7", + python_requires=">=3.8", classifiers=CLASSIFIERS, description="Asynchronous console and interfaces for asyncio", long_description=README, From afebccbbe9ed2e45eea0c809bdeb2e9dfb993d5a Mon Sep 17 00:00:00 2001 From: Vincent Michel Date: Sat, 9 Dec 2023 18:07:56 +0100 Subject: [PATCH 6/6] Fix pypy 3.9 tests --- tests/test_interact.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/test_interact.py b/tests/test_interact.py index 04c5ca2..89c0d9d 100644 --- a/tests/test_interact.py +++ b/tests/test_interact.py @@ -1,5 +1,6 @@ import io import os +import platform import sys import signal import asyncio @@ -93,11 +94,21 @@ async def test_interact_syntax_error(event_loop, monkeypatch): await assert_stream(reader, " a b") if sys.version_info >= (3, 10, 0) and sys.version_info < (3, 10, 1): await assert_stream(reader, " ^^^", loose=True) + else: + await assert_stream(reader, " ^", loose=True) + if ( + sys.version_info >= (3, 10, 0) + and sys.version_info < (3, 10, 1) + or ( + platform.python_implementation() == "PyPy" + and sys.version_info >= (3, 9) + and sys.version_info < (3, 10) + ) + ): await assert_stream( reader, "SyntaxError: invalid syntax. Perhaps you forgot a comma?" ) else: - await assert_stream(reader, " ^", loose=True) await assert_stream(reader, "SyntaxError: invalid syntax") await assert_stream(reader, sys.ps1)