poetry icon indicating copy to clipboard operation
poetry copied to clipboard

mark dry run mode in poetry output

Open piotr-kubiak opened this issue 1 year ago • 1 comments

Issue Kind

Change in current behaviour

Description

Currently, there is no difference in output between poetry install --dry-run and poetry install.

$ poetry install --dry-run
Installing dependencies from lock file

Package operations: 4 installs, 0 updates, 0 removals

  - Installing mdurl (0.1.2)
  - Installing pygments (2.18.0)
  - Installing markdown-it-py (3.0.0)
  - Installing rich (13.9.4)

Installing the current project: my-package (0.1.0)

$ poetry install
Installing dependencies from lock file

Package operations: 4 installs, 0 updates, 0 removals

  - Installing mdurl (0.1.2)
  - Installing pygments (2.18.0)
  - Installing markdown-it-py (3.0.0)
  - Installing rich (13.9.4)

Installing the current project: my-package (0.1.0)

Impact

This may be confusing, since observing only the output of poetry command, there is no way of telling if it was actually executed, or only simulated.

Workarounds

You need to observe both the command used (to check for dry-run flag) and the output (to see an actual output) in order to check if for example a package was installed. This makes scripting poetry output more challenging.

piotr-kubiak avatar Jan 06 '25 23:01 piotr-kubiak

I think it is better user experience if the --dry-run option will provide some description of what the command will do. The easiest solution is to just take a regular output and prepend it with a message. An "ideal" example in my opinion is git commit --dry-run.

piotr-kubiak avatar Jan 07 '25 11:01 piotr-kubiak