← Back to issue list

chore: resolve deprecation warnings

View original Github issue

Metadata

Project
snapcraft
Number
#5540
Type
pull request
State
merged
Author
bepri
Labels
Created
Updated
Closed

Current evaluation

Merged to resolve deprecation warnings before they become errors. Updates test mocking context manager setup. Approved by two reviewers and merged despite one failing integration test. Closes #5539.

Suggested action:

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `make lint`? - [x] Have you successfully run `make test`? --- Fixes some deprecation warnings before they become deprecation errors. Two of the fixes were very simple, but the one involving the context manager was a little bit messier. In short, the test mocking setup was setting the return value of a context manager to a simple `Path`, when it needed to be a generator object that supported the `__enter__()` method. This wasn't an issue previously since `Path` just did a no-op as a context manager, but now it needs to be correct. Closes #5539. SNAPCRAFT-1159

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged to resolve deprecation warnings before they become errors. Updates test mocking context manager setup. Approved by two reviewers and merged despite one failing integration test. Closes #5539.
qwen3.6-35b-a3b-mtp-q6 Merged to resolve deprecation warnings. Updates test mocking to correctly return generator objects for context managers, preventing future errors. Closes #5539.
qwen3.6-35b-a3b-mtp-q6 Merged changes resolving deprecation warnings before they become errors. Updated test mocking to return a proper generator object for a context manager instead of a Path instance. Closes #5539.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#5094 chore: fix deprecation warnings snapcraft merged Merged after approval by two reviewers. The change resolves deprecation warnings from external libraries by updating code across five files, ensuring compatibility and preventing future runtime issues.
82%
#5281 chore: clean up some warnings snapcraft merged Merged a cleanup commit series resolving deprecation warnings across 21 files, cutting test output from over 3000 to 700. Risky changes and upstream warnings were excluded. Approved by two reviewers and passed CI.
81%
#122 chore: eliminate pydantic warnings craft-archives merged Merged after two approvals and passing CI. Refactored three files to eliminate pydantic deprecation warnings, adding 24 lines and removing 15.
79%
#1353 chore(deps): update all dependencies charmcraft merged Merged dependency update across three files, changing 23 additions and 24 deletions. Approved by two reviewers with zero unresolved comments. Changes integrated successfully.
77%
#4696 chore(deps): update development dependencies (non-major) snapcraft merged Merged automated updates for Python type stubs via Renovate. Approved after passing CI and coverage checks. Maintainer deferred merge to address unrelated spread test failures before applying.
77%
#794 chore: remove pydantic warnings craft-parts merged Successfully merged after approval by two reviewers and passing CI checks. The changes remove pydantic warnings across 9 files, adding 30 lines and deleting 16 to clean up framework deprecation notices.
77%
#2444 chore: clean up unused/unnecessary files charmcraft merged Merged a chore change removing 286 lines across 10 unused files. Approved by two reviewers and integrated despite non-blocking macOS test failures and type checker warnings.
76%
#207 chore(deps): drop Pydantic dependency craft-cli merged Merged changes remove the unused Pydantic dependency, resolving issue #201. Approved by two reviewers, passed CI checks, and reduced code by three lines across three files without impacting the 94.76% test coverage.
76%
#2861 chore: remove prime key deprecation warning charmcraft merged Merged following two reviewer approvals. Removes the prime key deprecation warning, resolving issue #1786. The change deletes 24 lines in a single file and passed CI checks.
76%
#1355 chore(deps): update internal dependencies charmcraft merged Merged pull request updating internal dependencies. Approved by four reviewers with passing CI checks. The change modified two files, adding and removing four lines each.
76%