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

test rstream against python 3.11 #101

Closed
DanielePalaia opened this issue Jul 17, 2023 · 6 comments
Closed

test rstream against python 3.11 #101

DanielePalaia opened this issue Jul 17, 2023 · 6 comments

Comments

@DanielePalaia
Copy link
Collaborator

Currently we are using python 3.9.

It seems like there can be few issues with Python 3.11.

Scope of this task is to explore / see potential issues and try to correct them.

Also to think on a possible cross-testing Python3.9 and 3.11

@DanielePalaia
Copy link
Collaborator Author

See #100

@DanielePalaia
Copy link
Collaborator Author

DanielePalaia commented Jul 18, 2023

it seems to be an issue just with pytest when updating to Python 3.11:

Running poetry pytest I get

Traceback (most recent call last):
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 145, in __makeattr
    modpath, attrname = self.__map__[name]
                        ~~~~~~~~~~~~^^^^^^
KeyError: '__spec__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/bin/pytest", line 5, in <module>
    from pytest import console_main
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/pytest/__init__.py", line 5, in <module>
    from _pytest._code import ExceptionInfo
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/_pytest/_code/__init__.py", line 2, in <module>
    from .code import Code
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/_pytest/_code/code.py", line 42, in <module>
    from _pytest._io import TerminalWriter
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/_pytest/_io/__init__.py", line 1, in <module>
    from .terminalwriter import get_terminal_width
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/_pytest/_io/terminalwriter.py", line 10, in <module>
    from _pytest.compat import final
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/_pytest/compat.py", line 44, in <module>
    LEGACY_PATH = py.path. local
                  ^^^^^^^^^^^^^^
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 152, in __makeattr
    result = importobj(modpath, attrname)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 72, in importobj
    module = __import__(modpath, None, None, ['__doc__'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1138, in _find_and_load_unlocked
  File "/Users/dpalaia/Library/Caches/pypoetry/virtualenvs/rstream-kGMGy7PV-py3.11/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 150, in __makeattr
    raise AttributeError(name)
AttributeError: __spec__

@DanielePalaia
Copy link
Collaborator Author

DanielePalaia commented Jul 18, 2023

it seems to be similar to: pytest-dev/apipkg#30

Upgrading pytest to the last 7.4.0 doesn't seem to solve the issue.

@DanielePalaia
Copy link
Collaborator Author

DanielePalaia commented Jul 18, 2023

Hey @qweeze do you have any advise on this? it seems like an issue running poetry pytest when upgrading Python to 3.11
If we fix this we can try to upgrade all the other libraries too with a poetry update

@qweeze
Copy link
Owner

qweeze commented Jul 23, 2023

Upgrading pytest to the last 7.4.0 doesn't seem to solve the issue.

The problem is in the package py==1.10.0 which is pytest's dependency. Latest pytest==7.4.0 doesn't use it at all, so if you upgrade it via poetry it should remove this package:

$ python --version
Python 3.11.0

$ poetry add --group dev pytest@latest

Package operations: 0 installs, 1 update, 2 removals

  • Removing attrs (21.2.0)
  • Removing py (1.10.0)
  • Updating pytest (6.2.4 -> 7.4.0)

@DanielePalaia
Copy link
Collaborator Author

Implemented here: #110

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

No branches or pull requests

2 participants