You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and sure enough, /usr/local/lib/python3.12/dist-packages is an empty directory (I run a tight ship)
poetry unit tests assert that this is impossible:
$ pytest -k test_env_system_packages_are_relative_to_lib
...
=================================================== short test summary info ====================================================
FAILED tests/utils/env/test_env.py::test_env_system_packages_are_relative_to_lib[False] - Failed: No distributions found in the base environment of the virtualenv
FAILED tests/utils/env/test_env.py::test_env_system_packages_are_relative_to_lib[True] - Failed: No distributions found in the base environment of the virtualenv
Workarounds
I guess I could install something on my system just to keep the poetry unit tests happy
Poetry Installation Method
other
Operating System
Ubuntu 24.04
Poetry Version
1.8.4
Poetry Configuration
n/a
Python Sysconfig
No response
Example pyproject.toml
n/a
Poetry Runtime Logs
n/a
The text was updated successfully, but these errors were encountered:
It seems that the get_paths() returns locations that are "writable" by non distribution package managers. Site paths correctly infers the correct paths. I have not checked if installing something to the /user/local prefix will magically make the path show up in python -m site.
which I think seems more consistent: first the user base directory, then /usr/local/lib, then /usr/lib. I expect, or anyway hope, that Fedora know what they are doing though.
Either way: I expect the assertion should simply be removed from the tests.
The test failure is a symptom of a slightly larger issue I think. Specifically affecting cases Poetry tries to find what packages are already installed when system site packages are enabled in the virtual environment. Since Poetry does not find the package in what it considers the only paths to look for packages, it will try to install a package again which might lead to failure at build time.
Description
eg I am on ubuntu 24.04, and have a virtual environment derived from
/usr/bin/python3.12
, which in turns comes from thepython3.12-minimal
package:in that parent python:
and sure enough,
/usr/local/lib/python3.12/dist-packages
is an empty directory (I run a tight ship)poetry unit tests assert that this is impossible:
Workarounds
I guess I could install something on my system just to keep the poetry unit tests happy
Poetry Installation Method
other
Operating System
Ubuntu 24.04
Poetry Version
1.8.4
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
n/a
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: