未验证 提交 e329da7b 编写于 作者: F Frost Ming

Fix some typos

上级 6de84652
......@@ -67,7 +67,7 @@ class HelloCommand(BaseCommand):
### Register the command to the core object
Write a function somewhere in your plugin project. There is no limit on what the name of the function is,
but the function should take only one argument -- the PDM core object:
but the function should take only one argument -- the PDM core object:
```python hl_lines="2"
def hello_plugin(core):
......@@ -141,14 +141,14 @@ $ pdm install -d
```
After that, all the dependencies are available with a compatible Python interpreter, including the plugin itself, in editable mode. That means any change
to the codebase will take effect immediately without re-installation. The `pdm` executable also uses a Python interpreter under the hood,
to the codebase will take effect immediately without re-installation. The `pdm` executable also uses a Python interpreter under the hood,
so if you run `pdm` from inside the plugin project, the plugin in development will be activated automatically, and you can do some testing to see how it works.
That is how PEP 582 benefits our development workflow.
## Publish your plugin
Now you have defined your plugin already, let's distribute it to PyPI. PDM's plugins are discovered by entry point types.
Create an `pdm.plugin` entry point and point to your plugin callable (yeah, it doesn't need to be a function, any callable object can work):
Create an `pdm` entry point and point to your plugin callable (yeah, it doesn't need to be a function, any callable object can work):
**PEP 621**:
......@@ -193,11 +193,11 @@ Otherwise, if you installed `pdm` with normal `pip install`:
$ pip install --user pdm-hello
```
The core idea is you must install the plugin in the same site-package directory as `pdm`.
The main principle is you must install the plugin in the same site-package directory as `pdm`.
Now type in `pdm --help` in the terminal, you will see the new added `hello` command and use it:
```bash
$ pdm hello Jack
Hello, Jack
```
\ No newline at end of file
```
......@@ -29,7 +29,7 @@ def default_environment():
"platform_system": platform.system(),
"platform_version": platform.version(),
"python_full_version": platform.python_version(),
"platform_python_implementaiton": platform.python_implementation(),
"platform_python_implementation": platform.python_implementation(),
"python_version": ".".join(platform.python_version_tuple()[:2]),
"sys_platform": sys.platform,
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册