tox icon indicating copy to clipboard operation
tox copied to clipboard

AttributeError: 'Package' object has no attribute 'obj' when running tox

Open ALiwoto opened this issue 1 year ago • 0 comments

Issue

tox version 4.12.1 is failing on the exact same source code that was working with version 4.8.0 (which is around ~3 weeks ago).

Environment

  • OS: ubuntu-latest
Output of pip list of the host Python, where tox is installed
cachetools-5.3.2 chardet-5.2.0 colorama-0.4.6 distlib-0.3.8 filelock-3.13.1 packaging-23.2 platformdirs-4.1.0 pluggy-1.4.0 pyproject-api-1.6.1 tox-4.12.1 virtualenv-20.25.0

The versions that were working before:

cachetools-5.3.2 chardet-5.2.0 colorama-0.4.6 distlib-0.3.8 filelock-3.12.2 importlib-metadata-6.7.0 packaging-23.2 platformdirs-4.0.0 pluggy-1.2.0 pyproject-api-1.5.3 tomli-2.0.1 tox-4.8.0 typing-extensions-4.7.1 virtualenv-20.25.0 zipp-3.15.0

For full logs, you can take a look at this GitHub job (the one that was failing). Meanwhile the job that was passing ~3 weeks ago: here

I fixed the problem by pinning the tox version to 4.8.0 (i.e. used pip install tox==4.8.0 to install it); but thought maybe it's better I report it here.

Including the full tox output here (in case the GitHub jobs output expire:
platform linux -- Python 3.11.7, pytest-8.0.0, pluggy-1.4.0
cachedir: .tox/py/.pytest_cache
rootdir: /home/runner/work/WPyrogram/WPyrogram
plugins: cov-4.1.0, asyncio-0.23.3
asyncio: mode=Mode.STRICT
collected 0 items
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 272, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>                          ^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 325, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line [13](https://github.com/ALiwoto/WPyrogram/actions/runs/7685599709/job/20943522826#step:6:14)8, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/logging.py", line 783, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/warnings.py", line 118, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 121, in _multicall
INTERNALERROR>     teardown.throw(exception)  # type: ignore[union-attr]
INTERNALERROR>     ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1365, in pytest_collection
INTERNALERROR>     return (yield)
INTERNALERROR>             ^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 336, in pytest_collection
INTERNALERROR>     session.perform_collect()
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 799, in perform_collect
INTERNALERROR>     self.items.extend(self.genitems(node))
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 942, in genitems
INTERNALERROR>     yield from self.genitems(subnode)
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 937, in genitems
INTERNALERROR>     rep, duplicate = self._collect_one_node(node, handle_dupes)
INTERNALERROR>                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/main.py", line 825, in _collect_one_node
INTERNALERROR>     rep = collect_one_node(node)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/_pytest/runner.py", line 566, in collect_one_node
INTERNALERROR>     ihook.pytest_collectstart(collector=collector)
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/pytest_asyncio/plugin.py", line 626, in pytest_collectstart
INTERNALERROR>     pyobject = collector.obj
INTERNALERROR>                ^^^^^^^^^^^^^
/home/runner/work/WPyrogram/WPyrogram/.tox/py/lib/python3.11/site-packages/coverage/control.py:887: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")
INTERNALERROR> AttributeError: 'Package' object has no attribute 'obj'

============================ no tests ran in 0.01s =============================
py: exit 3 (0.41 seconds) /home/runner/work/WPyrogram/WPyrogram> coverage run -m pytest pid=19[16](https://github.com/ALiwoto/WPyrogram/actions/runs/7685599709/job/20943522826#step:6:17)
  py: FAIL code 3 (6.52=setup[6.11]+cmd[0.[41](https://github.com/ALiwoto/WPyrogram/actions/runs/7685599709/job/20943522826#step:6:42)] seconds)
  evaluation failed :( (6.[58](https://github.com/ALiwoto/WPyrogram/actions/runs/7685599709/job/20943522826#step:6:59) seconds)

ALiwoto avatar Jan 29 '24 08:01 ALiwoto