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

Make conda env update --prune ignore history specs. #9614

Merged
merged 8 commits into from
Aug 22, 2023

Conversation

tarcisioe
Copy link
Contributor

@tarcisioe tarcisioe commented Jan 17, 2020

This is supposed to solve #7279. The idea here is that if we are pruning we must use only the specs coming from environment.yml and ignore the history. Regression tests have also been added.

Resolves #7279

@tarcisioe tarcisioe requested a review from a team as a code owner January 17, 2020 21:07
@cla-bot
Copy link

cla-bot bot commented Jan 17, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@nicoddemus
Copy link
Contributor

Great work @tarcisioe! Fixing --prune means we can upgrade our conda version at @ESSS. 👍

@cla-bot
Copy link

cla-bot bot commented Jan 20, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@tarcisioe
Copy link
Contributor Author

@marcelotrevisani @msarahan I have submitted my CLA (twice, actually), is anything else needed for the bot to see it? Maybe it needs to be updated in .cla-signers?

@tarcisioe
Copy link
Contributor Author

Also, I believe appveyor/pr wasn't broken by my change, and I'm not too sure about what's happened in circleci conda-build. Should I do something about those?

@marcelotrevisani
Copy link
Member

@marcelotrevisani @msarahan I have submitted my CLA (twice, actually), is anything else needed for the bot to see it? Maybe it needs to be updated in .cla-signers?

Hi @tarcisioe , this process has a manual part lets say. @msarahan has to review and approve it. It seems to be a legal process which they cannot avoid.

@@ -363,6 +363,170 @@ def test_prune_1(tmpdir):
assert convert_to_dist_str(link_precs) == link_order


def test_update_prune_1(tmpdir):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests! :)

@marcelotrevisani
Copy link
Member

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Jan 22, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@cla-bot
Copy link

cla-bot bot commented Jan 22, 2020

The cla-bot has been summoned, and re-checked this pull request!

@kahing
Copy link

kahing commented Feb 6, 2020

what's the status of this? does the maintainer agree that this is the right fix?

@kahing
Copy link

kahing commented Feb 7, 2020

I tried to manually apply this patch to 4.8.2 and the steps in #7279 (comment) is still broken

@tarcisioe
Copy link
Contributor Author

@kahing It hasn't been reviewed yet by the maintainers. I will try to reproduce the steps you posted and investigate.

@tarcisioe
Copy link
Contributor Author

Well, shame on me I guess. I developed this patch on top of 4.7.x and trusted my regression tests. They are indeed still passing, so something else reintroduced the issue. I went through the major tags rebasing my patch onto them:

  • 4.7.9 was ok
  • 4.8.0 was ok
  • 4.8.1 stopped working

So I made a script that applied my patch and tested, and got the change that ended up nullifying my fix with git bisect. It was commit 03d22d4. I will work on matching my fix to what was intended on that commit now.

@cla-bot
Copy link

cla-bot bot commented Feb 7, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@tarcisioe
Copy link
Contributor Author

@kahing it's now rebased on master and when pruning the option "freeze-installed" is ignored (which was making packages that should otherwise be pruned be kept). I'm unsure if that is the best solution, but it basically reverts prune to the previous behaviour. Another regression test was added.

@kalefranz
Copy link
Contributor

Thanks for contributing this PR, and apologies for the delay in review. We're undergoing some changes in the Conda team right now, but it's our plan to be spending considerably more resources directly on Conda soon.

In particular for this PR, does this PR change the behavior of conda install --prune or conda update --prune?

@tarcisioe
Copy link
Contributor Author

@kalefranz It shouldn't. What it does is:

  • When prune is enabled, history is not included in the specs (since that ends up including every package in the spec and therefore avoids any package being pruned).
  • Disables FREEZE_INSTALLED when pruning. This was done mostly because I wasn't able to make both things work properly together, but I considered it reasonable since the change that introduced that modifier as a default (03d22d4) was made in between 4.8.0 and 4.8.1, when prune was already not working.

Therefore, --prune --freeze-installed will ignore --freeze-installed, but I am unsure if those flags ever worked together.

Also, no issues with the delay, I am aware of the size of conda as a project and how much work you guys have. I'm the one to thank you for the maintenance!

@cla-bot
Copy link

cla-bot bot commented Mar 17, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@cla-bot
Copy link

cla-bot bot commented Mar 24, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@prusse-martin
Copy link
Contributor

prusse-martin commented Mar 30, 2020

The current state can trigger an error due the missing installed specs.

@cla-bot
Copy link

cla-bot bot commented Jun 24, 2020

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Martin Prüsse.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Jun 25, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @tarcisioe. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@beeankha
Copy link
Contributor

pre-commit.ci autofix

conda/core/solve.py Outdated Show resolved Hide resolved
conda/core/solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
tests/core/test_solve.py Outdated Show resolved Hide resolved
conda/core/solve.py Outdated Show resolved Hide resolved
Co-authored-by: Ken Odegard <kodegard@anaconda.com>
Copy link
Contributor

@kenodegard kenodegard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it is passing 🎉, just need the news snippet and then this will be good to go

@beeankha beeankha changed the title Make update --prune ignore history specs. Make update --prune ignore history specs. Aug 18, 2023
@beeankha beeankha added the source::community catch-all for issues filed by community members label Aug 18, 2023
kenodegard
kenodegard previously approved these changes Aug 18, 2023
beeankha
beeankha previously approved these changes Aug 19, 2023
jaimergp
jaimergp previously approved these changes Aug 21, 2023
Copy link
Contributor

@jaimergp jaimergp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that --prune is only enabled in conda env. I had the impression that it was a general flag (and the code in solve.py does not check for the subcommand used), but it's not exposed in any other CLI. 🤷

For that reason, I'd change the PR title to "Make conda env update --prune ignore history specs"? Although the tests seem to be general and could be extended to conda update if the CLI was updated.

@beeankha beeankha changed the title Make update --prune ignore history specs. Make conda env update --prune ignore history specs. Aug 21, 2023
@beeankha beeankha dismissed stale reviews from jaimergp and themself via 0a93b66 August 21, 2023 20:00
@beeankha beeankha merged commit 9c7af40 into conda:main Aug 22, 2023
67 checks passed
jaimergp added a commit to conda/conda-libmamba-solver that referenced this pull request Aug 25, 2023
jaimergp added a commit to conda/conda-libmamba-solver that referenced this pull request Sep 15, 2023
* start branch

* trigger ci

* port logic from conda/conda#9614

* deselect a couple tests (accelerate and libmamba do not get along)

* add news

* Apply suggestions from code review

* Alternative logic for solver creation tasks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix tests/core/test_solve.py::test_auto_update_conda

* some progress with pins (but not quite there yet)

* Increase timeouts in CI env setup

* allow uninstall by default only on removals

* handle prune

* avoid crash

* cleanup

* only lock the installed spec

* pre-commit

* add SolverInputState.always_update helper mapping

* allow uninstall of conflicts

* use always_update list for simplicity

* not update-all if pinned

* explain pins if involved in errors

* re-enable original test_neutering_of_historic_specs

* bump minimum required conda and libmamba versions

* fix tests/core/test_solve.py::test_force_remove_1 and tests/core/test_solve.py::test_pinned_1

* Re-enable tests that are failing

* Require libmambapy >= 1.5.1

* pre-commit

* amend news

* Update __init__.py

* fix test_neutering_of_historic_specs

* consider 1.5.1 in warnings too

* pre-commit

* adjust test

* remove comment

* fix json serialization

* xfail in 1.5.1 too

* catch RuntimeError for the whole 1.5.x series

* xfail test_explicit

* fix test_pinned_1

* lock installed name-only pinned packages

* do not add installed channels to list if --override-channels in use

* add adjusted variant for test_priority

* always define lock

* explain some deselected tests

* adjust test_install_features

* xfail test_export

* pre-commit

---------

Co-authored-by: Jannis Leidel <jannis@leidel.info>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Ostrouchov <chris.ostrouchov@gmail.com>
@jezdez jezdez mentioned this pull request Sep 26, 2023
92 tasks
@nicoddemus nicoddemus deleted the ignore-history-on-prune branch November 7, 2023 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA source::community catch-all for issues filed by community members
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

conda env update --prune does not remove installed packages not defined in environment.yml