Skip to content

Commit

Permalink
Test on more recent Python versions.
Browse files Browse the repository at this point in the history
unpin pytest

fix

unpin ptk

unpin more

Update some new opcode:

LOAD_GLOBAL now shift by 1, and CACHE does nothing

dont ast.Bytes

reformat imports

missing import

mark failing

mark xfail

update xfail conditions

overzealous xfail
  • Loading branch information
Carreau committed Feb 26, 2024
1 parent 2ed5282 commit 9283312
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
include:
- os: macos-latest
python-version: "3.10"
Expand All @@ -31,7 +33,7 @@ jobs:
- name: Install and update Python dependencies on Python 3
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade "pexpect>=3.3" 'pytest<7' rlipython 'ipykernel>=5.4.3' requests jupyter flaky 'notebook<6.1' 'prompt_toolkit<3.0.15' wheel 'jupyter_console>=6.2' 'pytest-cov<3' ipython 'coverage<6.3' pytest-json-report
python -m pip install --upgrade "pexpect>=3.3" 'pytest<=7' rlipython 'ipykernel>=5.4.3' requests jupyter flaky 'notebook<6.1' wheel 'jupyter_console>=6.2' pytest-cov ipython coverage pytest-json-report
pip install -e .
- name: test release build
run: |
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
./report-*.json
- uses: codecov/codecov-action@v2
- name: Build docs
if: ${{ matrix.python-version == '3.10'}}
if: ${{ matrix.python-version == '3.12'}}
run: |
pip install sphinx sphinx_rtd_theme sphinx-autodoc-typehints
cd doc
Expand Down
9 changes: 7 additions & 2 deletions lib/python/pyflyby/_autoimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pyflyby._importstmt import Import
from pyflyby._log import logger
from pyflyby._modules import ModuleHandle
from pyflyby._parse import PythonBlock, infer_compile_mode
from pyflyby._parse import PythonBlock, infer_compile_mode, _is_ast_str

if sys.version_info >= (3, 12):
ATTRIBUTE_NAME = "value"
Expand All @@ -34,6 +34,11 @@
else:
LOAD_SHIFT = 0

if sys.version_info > (3, 11):
LOAD_SHIFT = 1
else:
LOAD_SHIFT = 0

NoneType = type(None)
EllipsisType = type(Ellipsis)

Expand Down Expand Up @@ -580,7 +585,7 @@ def _visit__all__(self, node):
if not isinstance(node.value, ast.List):
logger.warning("Don't know how to handle __all__ as (%s)" % node.value)
return
if not all(isinstance(e, ast.Str) for e in node.value.elts):
if not all(_is_ast_str(e) for e in node.value.elts):
logger.warning("Don't know how to handle __all__ with list elements other than str")
return
for e in node.value.elts:
Expand Down
7 changes: 3 additions & 4 deletions tests/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -3854,7 +3854,7 @@ def test_debug_tab_completion_db_1(frontend):
""", frontend=frontend)


@retry
@pytest.mark.xfail(IPython.version_info >= (8, 14), reason='not working on tab completion since https://github.com/ipython/ipython/pull/13889')
def test_debug_tab_completion_module_1(frontend, tmp):
# Verify that tab completion on module names works.
writetext(tmp.dir/"thornton60097181.py", """
Expand Down Expand Up @@ -3900,7 +3900,7 @@ def test_debug_tab_completion_multiple_1(frontend, tmp):
""", PYTHONPATH=tmp.dir, frontend=frontend)


@retry
@pytest.mark.xfail(IPython.version_info >= (8, 14), reason='not working on tab completion since https://github.com/ipython/ipython/pull/13889')
def test_debug_postmortem_tab_completion_1(frontend):
# Verify that tab completion in %debug postmortem mode works.
ipython("""
Expand All @@ -3922,7 +3922,7 @@ def test_debug_postmortem_tab_completion_1(frontend):
ipdb> q
""", frontend=frontend)


@pytest.mark.xfail(IPython.version_info >= (8, 14), reason='not working on tab completion since https://github.com/ipython/ipython/pull/13889')
def test_debug_namespace_1_py3(frontend):
# Verify that autoimporting and tab completion happen in the local
# namespace.
Expand Down Expand Up @@ -3953,7 +3953,6 @@ def test_debug_namespace_1_py3(frontend):
""", frontend=frontend)


@retry
def test_debug_second_1(frontend):
# Verify that a second postmortem debug of the same function behaves as
# expected.
Expand Down

0 comments on commit 9283312

Please sign in to comment.