FS#79602 - [python-tox] Incompatible with python-pyproject-api 1.6.1

Attached to Project: Arch Linux
Opened by Florian Bruhin (The-Compiler) - Thursday, 07 September 2023, 11:36 GMT
Last edited by Toolybird (Toolybird) - Thursday, 07 September 2023, 20:43 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

Since the upgrade to python-pyproject-api 1.6.1:
https://gitlab.archlinux.org/archlinux/packaging/packages/python-pyproject-api/-/commit/0b055f6c699e6664096c1c2dab2a503f34ae3d8b

Running tox in various projects results in:

Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
tox_env.setup()
File "/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 250, in setup
self._setup_with_env()
File "/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 143, in _setup_with_env
self._setup_pkg()
File "/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 166, in _setup_pkg
self._packages = self._build_packages()
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/runner.py", line 118, in _build_packages
packages = package_env.perform_packaging(self.conf)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
return meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 186, in perform_packaging
deps = self._load_deps(for_env)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
return meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 239, in _load_deps
deps = self._load_deps_from_built_metadata(for_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
return meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 283, in _load_deps_from_built_metadata
reqs = self.get_package_dependencies(for_env)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
return meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 292, in get_package_dependencies
self._ensure_meta_present(for_env)
File "/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
return meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 312, in _ensure_meta_present
dist_info = end.prepare_metadata_for_build_wheel(self.meta_folder, self._wheel_config_settings).metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'metadata'

This is due to tox 4.5.1 not being compatible with pyproject-api 1.6. Upstream didn't correctly specify that originally, which was fixed in tox 4.5.1.1:
https://github.com/tox-dev/tox/commit/2886397b3d98d914f04ca0229c657a1fa0d9952e

Downgrading to python-pyproject-api 1.5.4 makes things work again:
pacman -U https://archive.archlinux.org/packages/p/python-pyproject-api/python-pyproject-api-1.5.4-1-any.pkg.tar.zst

This renders tox unusable for running tests against multiple projects, among them pytest and vulture.

Additional info:
* package version(s): python-pyproject-api 1.6.1-1, python-tox 4.5.1.1-1
* link to upstream bug report, if any: https://github.com/tox-dev/tox/issues/3110 and https://github.com/jendrikseipp/vulture/issues/325

Steps to reproduce:

Create an empty folder with this tox.ini:

[tox]
envlist = py311

[testenv]
# Install package as wheel in all envs (https://hynek.me/articles/turbo-charge-tox/).
package = wheel
wheel_build_env = .pkg

and run "tox".
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 07 September 2023, 20:43 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-tox 4.11.1-1
Comment by Leonidas Spyropoulos (inglor) - Thursday, 07 September 2023, 11:44 GMT

Loading...