Skip to content

chore(types): type ui_schema and version_policy, drop their mypy over… - #417

Merged
rosspeili merged 1 commit into
ARPAHLS:mainfrom
UroojFatima-052:chore/issue-415-phase1-mypy
Oct 12, 2026
Merged

rosspeili merged 1 commit into
ARPAHLS:mainfrom
UroojFatima-052:chore/issue-415-phase1-mypy

Conversation

@UroojFatima-052

Copy link
Copy Markdown
Contributor

Refs #415

Phase 1: removes skillware.core.ui_schema and skillware.version_policy from [[tool.mypy.overrides]] and fixes the 4 errors that surfaced. Typing only, no behavior change.

Changes

  • ui_schema.py:84: normalize_fixture_samples returns dict(sample) so the list matches its List[JsonObject] return type. Fixture samples are JSON objects, so this is a same-content copy.
  • version_policy.py:68, 108: cast(Any, dist.metadata).get(...). PackageMetadata declares no .get on Python 3.10 (the configured python_version), while the runtime object has it. I kept .get rather than switching to ["Name"], since on newer Pythons a missing key there raises instead of returning None.
  • version_policy.py:77: cast("os.PathLike[str]", dist.locate_file(...)). I avoided str(...) so a non-filesystem locate_file result still raises and falls through to the existing except, as it does today.
  • pyproject.toml: both modules dropped from the overrides list.
  • CHANGELOG.md: Unreleased entry.

Verification

  • mypy skillware: Success, no issues in 23 files
  • black --check / flake8 on both files: clean
  • pytest tests/test_version_policy.py tests/test_card_ui_schema.py: 45 passed

@rosspeili

Copy link
Copy Markdown
Contributor

Thanks for tackling p1 so cleanly, @UroojFatima-052!

The typing fixes look great:

One quick thing before we merge: We cut release v0.5.8 yesterday, so the changelog diff currently slots this entry into the 0.5.8 section instead of [Unreleased]. Could you please rebase on latest main and move your entry under the top ## [Unreleased] -> ### Changed header?

Once that's rebased, this is ready to merge and you're good to take on phase 2!

@UroojFatima-052
UroojFatima-052 force-pushed the chore/issue-415-phase1-mypy branch from c291642 to de064bb Compare October 11, 2026 20:19
@UroojFatima-052

Copy link
Copy Markdown
Contributor Author

Hey @rosspeili,, Rebased on latest main and moved the entry under [Unreleased] -> ### Changed.

I'll start on phase 2 next.

@rosspeili rosspeili left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM @UroojFatima-052, merging as is. Thanks for this clean slice. Will keep #415 open until your last slice, which can close the issue. <3

@rosspeili
rosspeili merged commit c377998 into ARPAHLS:main Oct 12, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants