poetry icon indicating copy to clipboard operation
poetry copied to clipboard

**Opt-in** to ask confirmation before system changes, listing Venv and packages changes

Open pep-sanwer opened this issue 2 years ago • 1 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

Currently poetry install and poetry update execute without user confirmation of the packages to be installed / updated or the Venv those packages will be installed in. This feature requests opt-in (via flag and/or config) behavior for install/update akin to the below:

quick_start_python_env on  master via 🐍 v3.11.5 via 🅒 simple_test
λ mamba install seaborn

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (1.4.2) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████


Looking for: ['seaborn']

warning  libmamba Cache file "/home/devblade/mambaforge/pkgs/cache/497deca9.json" was modified by another program
warning  libmamba Cache file "/home/devblade/mambaforge/pkgs/cache/09cdf8bf.json" was modified by another program
conda-forge/noarch                                  14.1MB @   6.9MB/s  2.2s
conda-forge/linux-64                                34.9MB @   7.3MB/s  5.0s

Pinned packages:
  - python 3.11.*


Transaction

  Prefix: /home/devblade/mambaforge/envs/simple_test

  Updating specs:

   - seaborn
   - ca-certificates
   - openssl


  Package                 Version  Build                Channel                    Size
─────────────────────────────────────────────────────────────────────────────────────────
  Install:
─────────────────────────────────────────────────────────────────────────────────────────

  + brotli                  1.1.0  hd590300_1           conda-forge/linux-64       19kB
  + brotli-bin              1.1.0  hd590300_1           conda-forge/linux-64       19kB
  + certifi             2023.7.22  pyhd8ed1ab_0         conda-forge/noarch       Cached
  + contourpy               1.1.1  py311h9547e67_1      conda-forge/linux-64      235kB
  ...
  + seaborn                0.13.0  hd8ed1ab_0           conda-forge/noarch          7kB
  + seaborn-base           0.13.0  pyhd8ed1ab_0         conda-forge/noarch        234kB
  + six                    1.16.0  pyh6c4a22f_0         conda-forge/noarch       Cached
  + statsmodels            0.14.0  py311h1f0f07a_2      conda-forge/linux-64       12MB
  + xorg-libxau            1.0.11  hd590300_0           conda-forge/linux-64       14kB
  + xorg-libxdmcp           1.1.3  h7f98852_0           conda-forge/linux-64       19kB
  + zstd                    1.5.5  hfc55251_0           conda-forge/linux-64      545kB

  Upgrade:
─────────────────────────────────────────────────────────────────────────────────────────

  - openssl                 3.1.2  hd590300_0           conda-forge
  + openssl                 3.1.3  hd590300_0           conda-forge/linux-64        3MB

  Summary:

  Install: 48 packages
  Upgrade: 1 packages

  Total download: 128MB

─────────────────────────────────────────────────────────────────────────────────────────


Confirm changes: [Y/n]

Specifically, and minimally, the package change listing, as well as the venv that packages will be installed to (Prefix in the above)

As I understand the current feature set, a user can opt into seeing more information regarding either install or update with the --verbose/ -v flag, but these flags do not ask for confirmation before proceeding with system changes. A user can dry run the above commands (--dry-run), and while this provides the package change listing (but not the Venv that changes will be installed into - a user must issue poetry env info seperately for this information), it does not offer a good UX for interactive usage (a follow up command must be issued).

So currently, to capture the above feature request a user would: poetry env info -> confirm desired Venv poerty install/update --dry-run -> confirm desired changes poetry install/update

The request is to offer an opt-in flag and/or config setting that would provide bundle the three above commands in one, with a y/n confirmation gate before system changes, like: poetry install --confirm

Please let me know if this sounds like a useful UX knob the team would be interested in merging, and I'd love to give a PR a crack.

Appreciative of this incredible tool!

pep-sanwer avatar Oct 12 '23 20:10 pep-sanwer

IMO --dry-run is sufficient.

dimbleby avatar Oct 14 '23 07:10 dimbleby

--dry-run should be enough

Secrus avatar Oct 06 '24 17:10 Secrus

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 06 '24 00:11 github-actions[bot]