Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump poetry and pytest Python 3.11 compatibility #152

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sjlongland
Copy link
Contributor

Poetry has changed its project configuration schema in recent versions which breaks running tests.

In addition, pytest needs a bump in Python 3.11 because the older release tickles importlib the wrong way yielding a Can't open orphan path error when pytest tries to import hypothesis.

The previous version does not play nice with Python 3.11:

```
Package operations: 15 installs, 0 updates, 0 removals

  • Installing typed-ast (1.4.3): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-311
  creating build/lib.linux-x86_64-cpython-311/typed_ast
  copying typed_ast/__init__.py -> build/lib.linux-x86_64-cpython-311/typed_ast
  copying typed_ast/ast27.py -> build/lib.linux-x86_64-cpython-311/typed_ast
  copying typed_ast/ast3.py -> build/lib.linux-x86_64-cpython-311/typed_ast
  copying typed_ast/conversions.py -> build/lib.linux-x86_64-cpython-311/typed_ast
  creating build/lib.linux-x86_64-cpython-311/typed_ast/tests
  copying ast3/tests/test_basics.py -> build/lib.linux-x86_64-cpython-311/typed_ast/tests
  running build_ext
  building '_ast27' extension
  creating build/temp.linux-x86_64-cpython-311
  creating build/temp.linux-x86_64-cpython-311/ast27
  creating build/temp.linux-x86_64-cpython-311/ast27/Custom
  creating build/temp.linux-x86_64-cpython-311/ast27/Parser
  creating build/temp.linux-x86_64-cpython-311/ast27/Python
  x86_64-pc-linux-gnu-gcc -Wsign-compare -DNDEBUG -fPIC -Iast27/Include -I/tmp/tmphb_kq6hh/.venv/include -I/usr/include/python3.11 -c ast27/Custom/typed_ast.c -o build/temp.linux-x86_64-cpython-311/ast27/Custom/typed_ast.o
  In file included from ast27/Custom/typed_ast.c:3:
  ast27/Custom/../Include/compile.h:5:10: fatal error: code.h: No such file or directory
      5 | #include "code.h"
        |          ^~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-pc-linux-gnu-gcc' failed with exit code 1
```
Can't install 1.2 now, and 1.3+ don't understand the old 1.2
`dev-dependencies` config option.

https://python-poetry.org/docs/1.4/managing-dependencies/#dependency-groups
```
______________________________________________ ERROR collecting tests/test_utils.py _______________________________________________
tests/test_utils.py:3: in <module>
    from hypothesis import provisional
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:170: in exec_module
    exec(co, module.__dict__)
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/hypothesis/provisional.py:37: in <module>
    _comment, *_tlds = traversable.read_text(encoding="utf-8").splitlines()
/usr/lib/python3.11/importlib/resources/abc.py:83: in read_text
    with self.open(encoding=encoding) as strm:
/usr/lib/python3.11/importlib/resources/_adapters.py:141: in open
    raise FileNotFoundError("Can't open orphan path")
E   FileNotFoundError: Can't open orphan path
======================================================== warnings summary =========================================================
../../../../.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/passlib/utils/__init__.py:854
  /home/stuartl/.cache/pypoetry/virtualenvs/amqtt-4HWVaFGY-py3.11/lib/python3.11/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
    from crypt import crypt as _crypt

-- Docs: https://docs.pytest.org/en/stable/warnings.html
===================================================== short test summary info =====================================================
ERROR tests/test_utils.py - FileNotFoundError: Can't open orphan path
```
@mlasch
Copy link

mlasch commented Apr 1, 2024

Is there any chance to get this merged any time soon? This is also a prerequisite to work on Python 3.12 compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants