Skip to content

Commit

Permalink
Support python 3.12 and deprecate python 3.7
Browse files Browse the repository at this point in the history
* Make it working with newer Pythons by accepting potential new kwargs
  • Loading branch information
vxgmichel authored Dec 9, 2023
2 parents 3bbd8ac + afebccb commit e6c7cd5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.11'
- uses: pre-commit/[email protected]

Tests:
Expand All @@ -19,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", "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 }}
Expand All @@ -29,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
Expand Down
4 changes: 3 additions & 1 deletion aioconsole/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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,
Expand Down
13 changes: 12 additions & 1 deletion tests/test_interact.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os
import platform
import sys
import signal
import asyncio
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit e6c7cd5

Please sign in to comment.