← Back to issue list

fix: annotate _temporary_home_dir as a generator

View original Github issue

Metadata

Project
craft-archives
Number
#258
Type
pull request
State
merged
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

Fixed lint-ty deprecation warning by annotating _temporary_home_dir() return type as Generator instead of Iterator in apt_key_manager.py.

Resolution: closed resolved

Reason: Merged PR #258 resolves the lint-ty deprecation warning by updating the @contextmanager return type annotation from Iterator to Generator.

Evaluated by: mr-cal-bot

No scores available.

Issue body

## Summary `make lint` fails on `main` because of the `lint-ty` target added in [a658571](https://github.com/canonical/craft-archives/commit/a658571): ```text warning[deprecated]: The overload of `contextmanager` is deprecated --> craft_archives/repo/apt_key_manager.py:293:2 293 | @contextmanager | ^^^^^^^^^^^^^^ Annotating the return type as `-> Iterator[Foo]` with | `@contextmanager` is deprecated. Use `-> Generator[Foo]` instead. ``` `_temporary_home_dir()` is a `@contextmanager`-decorated generator, so it must be annotated as a `Generator` rather than an `Iterator`. This change is independent of the Starbase sync and is split out so the merge PR diff stays limited to the sync. ## Changes - `craft_archives/repo/apt_key_manager.py`: annotate `_temporary_home_dir()` as `Generator[pathlib.Path, None, None]` and import `Generator` instead of `Iterator` under `TYPE_CHECKING`. ## Validation - `make lint-ty` (was failing, now passes) - `make lint-code lint-twine lint-uv-lockfile lint-actions` - `make test-fast` (256 passed, 1 skipped)

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b — closed resolved Fixed lint-ty deprecation warning by annotating _temporary_home_dir() return type as Generator instead of Iterator in apt_key_manager.py.
~deepseek/deepseek-pro-latest
Impact: 25
Quick Win: 20
Complexity: 5
Confidence: 90
Actionability: 85
needs review Fixes lint-ty deprecation by annotating _temporary_home_dir as Generator[pathlib.Path, None, None] instead of Iterator; approved, tests passing, only unrelated OSV-scanner check failing.
~deepseek/deepseek-pro-latest
Impact: 20
Quick Win: 16
Complexity: 5
Confidence: 85
Actionability: 85
needs review Annotate _temporary_home_dir as Generator[pathlib.Path, None, None] instead of Iterator to fix the lint-ty deprecation warning; 2-line change, CI green except unrelated OSV-scanner failure and one pending Fast test.
~deepseek/deepseek-pro-latest
Impact: 25
Quick Win: 19
Complexity: 5
Confidence: 85
Actionability: 80
needs review Annotates _temporary_home_dir as Generator[pathlib.Path, None, None] and swaps the TYPE_CHECKING import from Iterator to Generator, fixing a lint-ty deprecation warning. 2-line diff; CI mostly green except OSV-scanner.
~deepseek/deepseek-pro-latest
Impact: 25
Quick Win: 19
Complexity: 5
Confidence: 90
Actionability: 80
needs review Changes _temporary_home_dir() annotation from Iterator to Generator and swaps the TYPE_CHECKING import, fixing a deprecated-contextmanager lint failure from the new lint-ty target. Clean 2-line diff, CI passing, awaiting review.

Update history

Date Change
merged
updated
updated
updated
created

Related issues

No related issues found above the similarity threshold.