[1.2.0a2] `poetry plugin remove` uninstalls poetry itself
See original GitHub issue- I am using the 1.2.0a2 pre-release (i.e. not latest (1.1.7))
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name:
Linux #71-Ubuntu SMP Tue Jul 13 15:59:12 UTC 2021
- Poetry version:
1.2.0a2
- Link of a Gist with the contents of your pyproject.toml file: Not applicable
📝 If you track pre-release issues elsewhere and this is a known problem, then please close this issue 😃
Issue
tl;dr: poetry plugin remove <plugin>
uninstalls poetry itself from $POETRY_HOME/venv
, presumably because poetry is a dependency of plugins. This leaves a broken installation of poetry, requiring reinstall from install-poetry.py
.
Steps to reproduce
📝 The steps below use the
poetry-dotenv-plugin
because its available on PyPi and the steps will work for anyone, but I have confirmed this also occurs with simple hello-world plugins created by following the documentation.
-
Install latest poetry:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py > install-poetry.py python install-poetry --preview
Output:
Retrieving Poetry metadata # Welcome to Poetry! This will download and install the latest version of Poetry, a dependency and package manager for Python. It will add the `poetry` command to Poetry's bin directory, located at: $POETRY_HOME/bin You can uninstall at any time by executing this script with the --uninstall option, and these changes will be reverted. Installing Poetry (1.2.0a2): Done Poetry (1.2.0a2) is installed now. Great! You can test that everything is set up by executing: `poetry --version`
-
Install a plugin:
poetry plugin add poetry-dotenv-plugin
Output:
Using version ^0.1.0-alpha.2 for poetry-dotenv-plugin Updating dependencies Resolving dependencies... (3.4s) Writing lock file Package operations: 2 installs, 1 update, 0 removals • Installing python-dotenv (0.19.0) • Updating keyring (23.0.1 -> 22.3.0) • Installing poetry-dotenv-plugin (0.1.0a2)
-
Check the plugin is installed:
poetry plugin show
Output:
• poetry-dotenv-plugin (0.1.0a2) A Poetry plugin to automatically load environment variables from .env files 1 application plugin Dependencies - poetry (>=1.2.0a1) - python-dotenv (>=0.10.0)
-
Remove the plugin:
poetry plugin remove poetry-dotenv-plugin
Output (note that
poetry-core
andcleo
are removed):Updating dependencies Resolving dependencies... (0.1s) Writing lock file Package operations: 0 installs, 0 updates, 39 removals • Removing appdirs (1.4.4) • Removing cachecontrol (0.12.6) • Removing cachy (0.3.0) • Removing certifi (2021.5.30) • Removing cffi (1.14.6) • Removing charset-normalizer (2.0.4) • Removing cleo (1.0.0a4) • Removing crashtest (0.3.1) • Removing cryptography (3.4.7) • Removing distlib (0.3.2) • Removing entrypoints (0.3) • Removing filelock (3.0.12) • Removing html5lib (1.1) • Removing idna (3.2) • Removing importlib-metadata (1.7.0) • Removing jeepney (0.7.1) • Removing keyring (22.3.0) • Removing lockfile (0.12.2) • Removing msgpack (1.0.2) • Removing packaging (20.9) • Removing pexpect (4.8.0) • Removing pkginfo (1.7.1) • Removing poetry-core (1.1.0a6) • Removing poetry-dotenv-plugin (0.1.0a2) • Removing ptyprocess (0.7.0) • Removing pycparser (2.20) • Removing pylev (1.4.0) • Removing pyparsing (2.4.7) • Removing python-dotenv (0.19.0) • Removing requests (2.26.0) • Removing requests-toolbelt (0.9.1) • Removing secretstorage (3.3.1) • Removing shellingham (1.4.0) • Removing six (1.16.0) • Removing tomlkit (0.7.2) • Removing urllib3 (1.26.6) • Removing virtualenv (20.4.4) • Removing webencodings (0.5.1): Removing... • Removing zipp (3.5.0): Removing...
-
Confirm that poetry install is broken:
poetry --version
Output:
Traceback (most recent call last): File "/home/jack/.poetry/bin/poetry", line 5, in <module> from poetry.console.application import main File "/home/jack/.poetry/venv/lib/python3.9/site-packages/poetry/console/application.py", line 12, in <module> from cleo.application import Application as BaseApplication ModuleNotFoundError: No module named 'cleo'
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:5 (4 by maintainers)
Thanks for testing @lafrenierejm, appreciate it.
Tested too on 1.2.0b2 and the removal of the plugin left poetry’s own dependencies untouched, so closing this issue.
Everything looks good when running this from c1475a0b6dd6f4a3e99112cc36b8c0d1024e4048, the current HEAD of master.