← Back to issue list

{catkin,python} plugin: support cleaning

View original Github issue

Metadata

Project
snapcraft
Number
#2171
Type
pull request
State
merged
Author
kyrofa
Labels
Created
Updated
Closed

Current evaluation

Merged into master. Fixes LP #1778716 by deferring Python lookup in the Pip class until cleanup. Resolves a crash in Catkin and Python plugins when cleaning the pull step after Python is removed from the installdir.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- Both the Catkin and Python plugins utilize the Pip class in order to clean their pull steps (specifically, they tell the Pip class to clean its packages). However, when cleaning the pull step, Python has already been removed from the installdir, which means the Pip class cannot be instantiated, causing an error about being unable to find Python. It's reasonable to ask Pip to clean any fetched packages, and doing so doesn't require Python. This PR fixes LP: [#1778716](https://bugs.launchpad.net/snapcraft/+bug/1778716) by lazily looking for Python only when it's required instead of upon class instantiation.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged into master. Fixes LP #1778716 by deferring Python lookup in the Pip class until cleanup. Resolves a crash in Catkin and Python plugins when cleaning the pull step after Python is removed from the installdir.
qwen3.6-35b-a3b-mtp-q6 Merged into master. Resolves catkin and python plugin cleanup failures by deferring Python initialization in the Pip class until actually required. This lazy loading prevents instantiation errors after Python is removed from the installdir, fixing Launchpad bug #1778716.
qwen3.6-35b-a3b-mtp-q6 Merged into master. Resolves a catkin and python plugin bug where cleaning the pull step failed due to premature Python removal. The Pip class now defers Python detection until required, fixing Launchpad bug #1778716.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#882 Python plugin: remove pip packages when cleaning pull. snapcraft merged Resolved Launchpad bug #1630005 by removing the part directory packages during the Python plugin pull step cleanup. Merged following reviewer approval and passing CI checks, updating two files.
72%