-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_env_system_packages_are_relative_to_lib fails on some systems #9878
Comments
Was discussing this internally on discord. The issue is the same on Fedora as well. python -c 'import json; import sysconfig; print(json.dumps(sysconfig.get_paths()))' | jq
{
"stdlib": "/usr/lib64/python3.13",
"platstdlib": "/usr/local/lib64/python3.13",
"purelib": "/usr/local/lib/python3.13/site-packages",
"platlib": "/usr/local/lib64/python3.13/site-packages",
"include": "/usr/include/python3.13",
"platinclude": "/usr/include/python3.13",
"scripts": "/usr/local/bin",
} $ python -m site
sys.path = [
'/tmp',
'/usr/lib64/python313.zip',
'/usr/lib64/python3.13',
'/usr/lib64/python3.13/lib-dynload',
'/home/abn/.local/lib/python3.13/site-packages',
'/usr/lib64/python3.13/site-packages',
'/usr/lib/python3.13/site-packages',
]
USER_BASE: '/home/abn/.local' (exists)
USER_SITE: '/home/abn/.local/lib/python3.13/site-packages' (exists)
ENABLE_USER_SITE: True It seems that the |
it is not going to matter but for interest I have
which I think seems more consistent: first the user base directory, then 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. |
With this change, when using newer Python versions (>=3.12), Poetry correctly detects and considers read-only system site packages when an environment is loaded. Resolves: python-poetry#9878
With this change, when using newer Python versions (>=3.12), Poetry correctly detects and considers read-only system site packages when an environment is loaded. Resolves: python-poetry#9878
With this change, when using newer Python versions (>=3.12), Poetry correctly detects and considers read-only system site packages when an environment is loaded. Resolves: python-poetry#9878
With this change, when using newer Python versions (>=3.12), Poetry correctly detects and considers read-only system site packages when an environment is loaded. Resolves: python-poetry#9878
With this change, when using newer Python versions (>=3.12), Poetry correctly detects and considers read-only system site packages when an environment is loaded. Resolves: #9878
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: