poetry-1.2.1-3.fc38 has several problems in %check that were introduced in the latest update 1. there is a typo "bootstap" (missing r), causing the condition to always evaluate to 0, hence the tests never run 2. when the typo is fixed, the condition is reversed, should be %if %{without bootstrap} 3. when the tests run, there are import errors (missing modules flatdict and deepdiff, packages not yet packaged in Fedora) 4. when the affected files are --ignore'd, there are 14 tests failures, many of them with permission errors writing to /usr/src/demo A work in progress diff: -%if %{with bootstap} +%if %{without bootstrap} %check # don't use %%tox here because tox.ini runs "poetry install" # test_lock_no_update: attempts a network connection to pypi @@ -79,10 +79,16 @@ done # virtualenv: error: argument dest: the destination . is not write-able at / # test_executor and test_editable_builder doesn't work with pytest7 # upstream report: https://github.com/python-poetry/poetry/issues/4901 +# the --ignore'd files need not yet packaged flatdict and deepdiff %pytest -k "not lock_no_update and \ not export_exports_requirements_txt_file_locks_if_no_lock_file and \ not executor and \ -not editable_builder" +not editable_builder" \ +--ignore tests/config/test_config.py \ +--ignore tests/console/commands/test_config.py \ +--ignore tests/masonry/builders/test_editable_builder.py \ +--ignore tests/test_factory.py \ +--ignore tests/utils/test_dependency_specification.py %endif
We've talked about this with Tomáš now. Some raw notes before we forget: 5 of the tests fail with: tests/helpers.py:122: in mock_clone dest.parent.mkdir(parents=True, exist_ok=True) This is here https://github.com/python-poetry/poetry/blob/1.2.1/tests/helpers.py#L124 -- for some reason, source_dir is /usr, which is weird, but the problem seems to be a problem in tests only. The next step is to determine whether /usr is set from https://github.com/python-poetry/poetry/blob/1.2.1/tests/helpers.py#L121 or from the way the function is called and continue with more detective work from there. ------------ 9 tests fail with: def get_embedded_wheel(self, distribution: str) -> Path: wheel: Wheel = get_embed_wheel( distribution, f"{self.version_info[0]}.{self.version_info[1]}" ) > path: Path = wheel.path E AttributeError: 'NoneType' object has no attribute 'path' This is here https://github.com/python-poetry/poetry/blob/1.2.1/src/poetry/utils/env.py#L1270 -- because we patch virtualenv to remove bundled wheels, the get_embed_wheel() function always returns None. I've proposed hotpatching the function more or less to: def get_embedded_wheel(self, distribution: str) -> Path: from virtualenv.util.path._system_wheels import get_system_wheels_paths wheel_paths = get_system_wheels_paths(self._executable) for wheel_dir in wheel_paths: pip_wheels = sorted(wheel_dir.glob('pip-*.whl')) if not pip_wheels: break return pip_wheels[0] raise RuntimeError(...) We might talk to Lumír about exposing get_system_wheel("pip") from virtualenv, so we don't need to reimplement that here. Later, we need to talk to poetry upstream and ask them why they want the embed wheel explicitly rather than "a wheel" and if they just use the embed one because it is easy for them, we might change that as well. This problem is ubiquitous in the tests because the tested virtualenvs don't have pip in them. That is the default for tests but not for users. However, users can configure their virtualenvs to be pip-less. See https://python-poetry.org/docs/configuration/#virtualenvsoptionsno-pip tl;dr this has uncovered a problem that can most probably surface to some of our users, hence setting severity to medium (it's rawhide only and requires a specific config option that has not existed in older poetry versions)
'pip-*.whl' should have been f'{distribution}-*.whl'
PR: https://src.fedoraproject.org/rpms/poetry/pull-request/32
FEDORA-2022-b3ab90e661 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-b3ab90e661
FEDORA-2022-b3ab90e661 has been pushed to the Fedora 38 stable repository. If problem still persists, please make note of it in this bug report.