-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
[bug] ubuntu plugins not valid after installation #3289
Comments
Noticed that: # models/in_process/sysconfig_get_paths.py # L31
def get_paths(kind="default", vars=None):
...
else:
if sys.platform == "darwin" and "osx_framework_library" in scheme_names and kind == "prefix":
return sysconfig.get_paths("posix_prefix", vars=vars)
return sysconfig.get_paths(vars=vars) ubuntu's # core.py # L314
def _add_project_plugins_library(self) -> None:
...
scheme = "nt" if os.name == "nt" else "posix_prefix"
purelib = sysconfig.get_path("purelib", scheme, replace_vars) the scheme is "posix_prefix", that's the reason that installation and loding routes are different. I tried to change scheme to "posix_local", and the plugins could be loaded successfully. Since I only have windows and ubuntu system computers, I'm not sure how to fix it correctly in all systems. On my ubuntu computer, if kind == "prefix":
if (sys.platform == "darwin" and "osx_framework_library" in scheme_names) or (sys.platform == "linux"):
return sysconfig.get_paths("posix_prefix", vars=vars) ? But I'm afraid it may fail on other systems such as centos |
Perhaps if kind == "prefix":
if (sys.platform == "darwin" and "osx_framework_library" in scheme_names) or (sys.platform == "linux" and "deb_system" in scheme names): would be better, but I have no way to test it on other systems |
Here's the sysconfig from a macOS 14.7 (Apple silicon and Python 3.11.10):
|
I believe if kind == "prefix" and os.name != "nt":
return sysconfig.get_paths("posix_prefix", vars=vars) is enough. |
Describe the bug
plugins is invalid after installation on Ubuntu
To reproduce
In one pdm project, create plugin/my_plugin.py
and plugin/pyproject.toml
In pyproject.toml, add
run
pdm install --plugins
, make sure the plugins are installed successfully by checking.pdm-plugins
which should beThen, try to type something starts with
pdm
likepdm lock
Expected Behavior
If the plugin is valid, whatever you input, "test" would be output as long as you are running a
pdm
commandEnvironment Information
pdm 2.20.1
ubuntu 22.04
pdm -v output
No response
Additional Context
Reason Analysis
On windows system, plugins' installation route and loading route would be the same, both
${PROJECT}/.pdm-plugins/Lib/site-packages
, but on ubuntu they are different.On ubuntu, as
site.py
saidSo the installation route would be
/${PROJECT}/.pdm-plugins/local/lib/python{ver}/dist-packages
, while the loading route got bywould be
${PROJECT}/.pdm-plugins/lib/python{ver}/site-pacakges
, so pdm would not load any plugins on ubuntu.In fact, when I manually change the
local/lib/python{ver}/dist-packages
tolib/python{ver}/site-pacakges
, plugins are enabled.So, the two routes on ubuntu must somehow be consistent.
Are you willing to submit a PR to fix this bug?
The text was updated successfully, but these errors were encountered: