Skip to content
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

How to write a pdm plugin? #227

Closed
WAY29 opened this issue Jan 20, 2021 · 6 comments
Closed

How to write a pdm plugin? #227

WAY29 opened this issue Jan 20, 2021 · 6 comments

Comments

@WAY29
Copy link

WAY29 commented Jan 20, 2021

我已经查看了doc中关于plugin中的内容
但是似乎缺乏了如何使插件生效/测试插件的演示...

@frostming
Copy link
Collaborator

publish了以后别人只要 pip install pdm-plugin (在和pdm相同的环境中)就自动生效

@WAY29
Copy link
Author

WAY29 commented Jan 20, 2021

publish了以后别人只要 pip install pdm-plugin (在和pdm相同的环境中)就自动生效

明白了 但是这样的话在本地测试有点麻烦(需要不断build install)

@frostming
Copy link
Collaborator

frostming commented Jan 20, 2021

补充了一点文档

但是这样的话在本地测试有点麻烦(需要不断build install)

可以pip install -e .(.是当前开发插件的项目目录)

@WAY29
Copy link
Author

WAY29 commented Jan 20, 2021

补充了一点文档

但是这样的话在本地测试有点麻烦(需要不断build install)

可以pip install -e .(.是当前开发插件的项目目录)

使用pip -e我会遇到以下问题

ERROR: File "setup.py" not found. Directory cannot be installed in editable mode: path
(A "pyproject.toml" file was found, but editable mode currently requires a setup.py based build.)

@frostming
Copy link
Collaborator

frostming commented Jan 20, 2021

hmm, 按道理PEP 582 自动加载可解
这里有关于如何启用
https://pdm.fming.dev/#enable-pep-582-globally

启用之后只用在插件项目中执行:pdm install -d,然后在本项目中 pdm是启用了插件的状态,出去就不是

@WAY29
Copy link
Author

WAY29 commented Jan 20, 2021

hmm, 按道理PEP 582 自动加载可解
这里有关于如何启用
https://pdm.fming.dev/#enable-pep-582-globally

启用之后只用在插件项目中执行:pdm install -d,然后在本项目中 pdm是启用了插件的状态,出去就不是

非常感谢你的帮助 :(我觉得可以把这点写在文档里让更多人知道

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants