Linux command
poetry-remove 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Remove a dependency
poetry remove [package]
Remove dev dependency
poetry remove --group dev [package]
Remove multiple packages
poetry remove [package1] [package2]
Dry run
poetry remove --dry-run [package]
说明
poetry remove removes one or more dependencies from the project, updating both pyproject.toml and the lock file. It also uninstalls the packages and any orphaned transitive dependencies from the virtual environment. Use -G to remove from a specific dependency group (e.g., dev, test). The --dry-run flag shows what would be removed without making changes.
参数
- -G, --group _GROUP_
- Remove from specific group.
- -D, --dev
- Remove from dev dependencies (deprecated, use -G dev instead).
- --dry-run
- Simulate removal without making changes.
- --lock
- Only update the lock file, do not uninstall packages.
FAQ
What is the poetry-remove command used for?
poetry remove removes one or more dependencies from the project, updating both pyproject.toml and the lock file. It also uninstalls the packages and any orphaned transitive dependencies from the virtual environment. Use -G to remove from a specific dependency group (e.g., dev, test). The --dry-run flag shows what would be removed without making changes.
How do I run a basic poetry-remove example?
Run `poetry remove [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -G, --group _GROUP_ do in poetry-remove?
Remove from specific group.