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

Tox fails to start with Python 3.11.0a1 #2249

Closed
ollipa opened this issue Oct 13, 2021 · 2 comments
Closed

Tox fails to start with Python 3.11.0a1 #2249

ollipa opened this issue Oct 13, 2021 · 2 comments
Labels
bug:normal affects many people or has quite an impact

Comments

@ollipa
Copy link

ollipa commented Oct 13, 2021

Tox fails to start with Python 3.11.0a1:

> tox -rvv
Traceback (most recent call last):
  File "/tmp/.venv/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 "/tmp/.venv/bin/tox", line 5, in <module>
    from tox import cmdline
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/tox/__init__.py", line 32, in <module>
    from .session import cmdline  # isort:skip
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/tox/session/__init__.py", line 20, in <module>
    from tox import reporter
    ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/tox/reporter.py", line 127, in <module>
    _INSTANCE = Reporter()
                ^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/tox/reporter.py", line 32, in __init__
    self._reset(**kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/tox/reporter.py", line 38, in _reset
    self.tw = py.io.TerminalWriter()
              ^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 152, in __makeattr
    result = importobj(modpath, attrname)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/.venv/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 1083, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1043, in _find_and_load_unlocked
  File "/tmp/.venv/lib/python3.11/site-packages/py/_vendored_packages/apipkg/__init__.py", line 150, in __makeattr
    raise AttributeError(name)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: __spec__
> python --version
Python 3.11.0a1+
@ollipa ollipa added the bug:normal affects many people or has quite an impact label Oct 13, 2021
@gaborbernat
Copy link
Member

The problem is in apipkg please open an issue there.

@ollipa
Copy link
Author

ollipa commented Oct 17, 2021

Fix for this issue is tracked here:
pytest-dev/py#273

scop added a commit to scop/hashpipe that referenced this issue Oct 19, 2021
Up to 1.10.0 don't work with Python 3.11, causing pytest and tox not to
work.

Refs pytest-dev/pytest#9181
Refs tox-dev/tox#2249
scop added a commit to scop/hashpipe that referenced this issue Oct 19, 2021
Up to 1.10.0 don't work with Python 3.11, causing pytest and tox not to
work.

Refs pytest-dev/pytest#9181
Refs tox-dev/tox#2249
scop added a commit to scop/pytekukko that referenced this issue Oct 19, 2021
Use post 1.10.0 py snapshot to fix pytest and tox issues when the "host"
Python is 3.11 too.

Refs pytest-dev/pytest#9181
Refs tox-dev/tox#2249
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:normal affects many people or has quite an impact
Projects
None yet
Development

No branches or pull requests

2 participants