← Back to issue list

lint: use correct types for SnapSource test

View original Github issue

Metadata

Project
craft-parts
Number
#470
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

PR #470 merged (commit fb0d04d7) fixing Pyright 1.1.312 kwargs type errors in tests/unit/sources/test_snap_source.py by passing a ProjectDirs instance and int source_depth in the invalid-parameter test.

Resolution: closed resolved

Reason: The PR was merged into main as commit fb0d04d7 ("lint: use correct types for SnapSource test (#470)"), confirmed by the file history for tests/unit/sources/test_snap_source.py. It resolved the pyright errors by using ProjectDirs for project_dirs and an int for source_depth in the parametrized invalid-parameter test.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- [Pyright 1.1.312](https://github.com/microsoft/pyright/releases/tag/1.1.312) now type-checks kwargs. This started causing the following error: ``` pyright setup.py craft_parts tests /home/runner/work/craft-parts/craft-parts/tests/unit/sources/test_snap_source.py /home/runner/work/craft-parts/craft-parts/tests/unit/sources/test_snap_source.py:49:79 - error: Argument of type "str" cannot be assigned to parameter "source_depth" of type "int | None" in function "__init__" Type "str" cannot be assigned to type "int | None" "str" is incompatible with "int" Type cannot be assigned to type "None" (reportGeneralTypeIssues) /home/runner/work/craft-parts/craft-parts/tests/unit/sources/test_snap_source.py:49:79 - error: Argument of type "str" cannot be assigned to parameter "project_dirs" of type "ProjectDirs | None" in function "__init__" Type "str" cannot be assigned to type "ProjectDirs | None" "str" is incompatible with "ProjectDirs" Type cannot be assigned to type "None" (reportGeneralTypeIssues) 2 errors, 0 warnings, 0 informations ``` Similar to https://github.com/snapcore/snapcraft/pull/4205

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #470 merged (commit fb0d04d7) fixing Pyright 1.1.312 kwargs type errors in tests/unit/sources/test_snap_source.py by passing a ProjectDirs instance and int source_depth in the invalid-parameter test.
stealth/space-bunny-alpha — closed resolved Merged in canonical/craft-parts#470, updating SnapSource test arguments to their expected int and ProjectDirs types, resolving Pyright 1.1.312 type-checking errors.
qwen/qwen3.6-35b-a3b — — Merged fix for Pyright type-checking errors in test_snap_source.py. Corrected string arguments passed to SnapSource initialization to match expected int and ProjectDirs types. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged a fix for Pyright type-checking errors in test_snap_source.py. Corrected string arguments to match expected int and ProjectDirs types, resolving lint failures introduced by Pyright 1.1.312.

Update history

No update history recorded yet.

Related work

  • Related To: snapcore/snapcraft#4205 (confidence 85%)

    Referenced in the PR body as the analogous fix for the same Pyright kwargs type-checking change.

Related issues

No related issues found above the similarity threshold.