Closed ghost closed 5 years ago
this is a known api breaking fixup change, updating importlib_metadata and pluggy should resolve it
@RonnyPfannschmidt
importlib-metadata 0.21 pluggy 0.13.0
Those are the latest, no?
I was seeing this myself locally - but it was fixed eventually when cleaning the old Python 3.8 install, and re-installing it.
Argh true, so it's indeed look like a old python 3.8 build
Ref: https://gitlab.com/python-devs/importlib_metadata/issues/86
@nekokatt
This bug is present on CPython3.8-rc and CPython3.8-b4
There is no RC yet, is there? Try with a clean install, i.e. remove the existing installation before "make install".
My mistake, misread the docker page.
These are prebuilt images that are provided on Docker hub, so without rerunning that from scratch, which would involve pulling my CI configuration apart to change it, I don't really have control over that. Those are pulled from docker hub and then I do a fresh install on each run of pytest + co
Is pluggy importlib_metadata updated to the newest version as per that release, do we know? Or has this been updated on PyPi already for Pytest?
Thanks for the quick reply
Edit, this is still an issue with the most recent pytest pullable from pypi, as the dependency list on a pipeline I just ran reflects.
Installing importlib-metadata (0.21)
...
Installing pluggy (0.13.0)
...
Installing pytest (5.0.1)
...
$ poetry run nox -spytest
Running session pytest
Creating virtualenv using python in .nox/pytest
pip install poetry
poetry update
Updating dependencies
Resolving dependencies...
Nothing to install or update
poetry run python -W ignore::DeprecationWarning -m pytest --cov hikari.core --cov-config .coveragerc --cov-report term --cov-report annotate:public/coverage/annotated --cov-report html:public/coverage/html --cov-branch -ra --showlocals --testdox tests/hikari/core
Traceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/pytest.py", line 7, in <module>
from _pytest.config import cmdline
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/_pytest/config/__init__.py", line 12, in <module>
import importlib_metadata
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 527, in <module>
__version__ = version(__name__)
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 494, in version
return distribution(package).version
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 467, in distribution
return Distribution.from_name(package)
File "/root/.cache/pypoetry/virtualenvs/hikari.core-py3.8/lib/python3.8/site-packages/importlib_metadata/__init__.py", line 181, in from_name
dists = resolver(DistributionFinder.Context(name=name))
File "<frozen importlib._bootstrap_external>", line 1385, in find_distributions
File "/usr/local/lib/python3.8/re.py", line 275, in escape
pattern = str(pattern, 'latin1')
TypeError: decoding to str: need a bytes-like object, Context found
Command poetry run python -W ignore::DeprecationWarning -m pytest --cov hikari.core --cov-config .coveragerc --cov-report term --cov-report annotate:public/coverage/annotated --cov-report html:public/coverage/html --cov-branch -ra --showlocals --testdox tests/hikari/core failed with exit code 1
Session pytest failed.
Is there a reason pytest is not using the recommended importlib mechanism that is suggested at the PR you linked?
Can confirm it is now working with a version bump. Cheers for responding so quickly; greatly appreciated :)
Since this morning, Pytest on 3.8 has been failing due to an issue passing a Context object to functions in the regex model.
I am making this report on mobile, so apologies if I miss anything. Traceback is as follows:
My "pip freeze" from Poetry:
The pipeline that triggered this is here, if you need more information or anything let me know and I will try to dig down into my CI configuration to find out:
https://gitlab.com/nekokatt/hikari.core/-/jobs/292464486
I can confirm on behalf of another user that they are getting the exact same error running Pytest on Python3.8-rc-alpine on their repository.
This bug is present on CPython3.8-rc and CPython3.8-b4, and is not present on CPython3.7.x, nor PyPy 3.6 (that I am aware of).
Hope this is all the info you need for now. Thanks :)