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

5.1 fails for python 3.8 #5818

Closed
thirtytwobits opened this issue Sep 5, 2019 · 4 comments
Closed

5.1 fails for python 3.8 #5818

thirtytwobits opened this issue Sep 5, 2019 · 4 comments
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity

Comments

@thirtytwobits
Copy link

Our project's python3.8 tox run started to fail when using pytest 5.1 or greater.

nunavut tox -e py38-test

py38-test run-test: commands[1] | coverage run --parallel-mode --rcfile=/repo/setup.cfg -m pytest --basetemp=/repo/.tox/py38-test/tmp -p no:cacheprovider --rootdir=/repo /repo/test
Traceback (most recent call last):
  File "/repo/.tox/py38-test/lib/python3.8/site-packages/pytest.py", line 7, in <module>
    from _pytest.config import cmdline
  File "/repo/.tox/py38-test/lib/python3.8/site-packages/_pytest/config/__init__.py", line 30, in <module>
    from _pytest.compat import importlib_metadata
  File "/repo/.tox/py38-test/lib/python3.8/site-packages/_pytest/compat.py", line 30, in <module>
    from importlib import metadata as importlib_metadata  # noqa
ImportError: cannot import name 'metadata' from 'importlib' (/repo/.tox/py38-test/lib/python3.8/importlib/__init__.py)
Coverage.py warning: Module nunavut was never imported. (module-not-imported)
Coverage.py warning: No data was collected. (no-data-collected)
ERROR: InvocationError for command /repo/.tox/py38-test/bin/coverage run --parallel-mode --rcfile=/repo/setup.cfg -m pytest --basetemp=/repo/.tox/py38-test/tmp -p no:cacheprovider --rootdir=/repo test (exited with code 1)
@nicoddemus
Copy link
Member

Hi @thirtytwobits,

While we still have a few failing tests under our test suite on py38 (which we should try to fix soon), the problem you are describing should not exist, importlib is builtin in Python 3.8:

 λ py -3.8
Python 3.8.0b4 (tags/v3.8.0b4:d93605d, Aug 29 2019, 23:21:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib import metadata as importlib_metadata
>>>

Which Python 3.8 version are you using? Also, can you provide the output of:

py -3.8 -c "import importlib.metadata;print(importlib.metadata)"

@nicoddemus nicoddemus added the status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity label Sep 5, 2019
@thirtytwobits
Copy link
Author

Ah. I see what's going on now. This is a rolling break between pytest and python 3.8. 3.8 is not an official release so this is completely reasonable. I've rebuilt our docker container (https://cloud.docker.com/u/uavcan/repository/docker/uavcan/toxic) and this seems to work now. Sorry for the noise.

@Madoshakalaka
Copy link

I also get this error in a tox build:

Traceback (most recent call last):
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/bin/pytest", line 5, in <module>
    from pytest import main
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/pytest.py", line 6, in <module>
    from _pytest.assertion import register_assert_rewrite
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/_pytest/assertion/__init__.py", line 7, in <module>
    from _pytest.assertion import rewrite
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/_pytest/assertion/rewrite.py", line 26, in <module>
    from _pytest.assertion import util
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/_pytest/assertion/util.py", line 8, in <module>
    import _pytest._code
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/_pytest/_code/__init__.py", line 2, in <module>
    from .code import Code  # noqa
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/_pytest/_code/code.py", line 23, in <module>
    import pluggy
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/pluggy/__init__.py", line 16, in <module>
    from .manager import PluginManager, PluginValidationError
  File "/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/site-packages/pluggy/manager.py", line 9, in <module>
    from importlib import metadata as importlib_metadata
ImportError: cannot import name 'metadata' from 'importlib' (/home/matt/PycharmProjects/pipenv-setup/.tox/py38/lib/python3.8/importlib/__init__.py)

@xsteadfastx
Copy link

i also get this error while testing with python 3.8.0 and pytest 5.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity
Projects
None yet
Development

No branches or pull requests

4 participants