Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run conda clean after conda update if cleanup = true #1047

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maxkapur
Copy link

@maxkapur maxkapur commented Feb 20, 2025

What does this PR do

Conda provides a conda clean subcommand, sort of like apt autoremove, that automatically removes used unused packages, tarballs, and so on:

https://docs.conda.io/projects/conda/en/latest/commands/clean.html

This PR updates the Conda topgrade step to run conda clean --all if cleanup = true is set in the topgrade config. It adds --yes if topgrade is run with -y.

Standards checklist

  • The PR title is descriptive
  • I have read CONTRIBUTING.md
  • Optional: I have tested the code myself
  • (n/a) If this PR introduces new user-facing messages they are translated

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

@maxkapur
Copy link
Author

Notes:

  • conda clean also provides a --dry-run flag that could reflect whether topgrade itself was run with --dry-run. I haven't implemented this because I noticed that --dry-run is also not implemented for the conda update step anyway. I might implement --dry-run in a separate PR.
  • I have never contributed to this repo before and seldom use rust so please forgive any silly mistakes 😅

@maxkapur maxkapur changed the title Run conda clean after conda upgrade if cleanup = true Run conda clean after conda update if cleanup = true Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant