Skip to content

Run ty in pre-commit and CI - #84

Merged
MLopez-Ibanez merged 1 commit into
multi-objective:mainfrom
ZijunLee:contrib/moocore-19-ty-check
Oct 26, 2026
Merged

MLopez-Ibanez merged 1 commit into
multi-objective:mainfrom
ZijunLee:contrib/moocore-19-ty-check

Conversation

@ZijunLee

Copy link
Copy Markdown
Contributor

Summary

  • add the official ty pre-commit hook, scoped to the Python project
  • skip ty in pre-commit.ci because the hook requires network access, and run it in a dedicated GitHub Actions job instead
  • configure ty to check python/src and resolve the existing diagnostics without broadly disabling type-checking rules

Testing

  • pre-commit run check-yaml --all-files
  • pre-commit run pyproject-fmt --all-files
  • pre-commit run ruff-format --all-files
  • pre-commit run ruff --all-files
  • pre-commit run ty --all-files
  • tox -e type
  • Python 3.12 test suite: 98 passed, 2 xfailed

Addresses the “run ty on CI/pre-commit” task in #19.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.78%. Comparing base (518835b) to head (65b1032).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #84      +/-   ##
==========================================
- Coverage   77.81%   77.78%   -0.04%     
==========================================
  Files          71       71              
  Lines        7577     7588      +11     
  Branches     1477     1477              
==========================================
+ Hits         5896     5902       +6     
- Misses       1310     1314       +4     
- Partials      371      372       +1     
Flag Coverage Δ
python 74.98% <93.33%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
C 74.06% <ø> (-0.06%) ⬇️
R 81.24% <ø> (ø)
Python tests 100.00% <ø> (ø)
Python src 81.26% <93.33%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MLopez-Ibanez
MLopez-Ibanez force-pushed the contrib/moocore-19-ty-check branch 4 times, most recently from debb585 to 25e5ead Compare October 25, 2026 09:59
@github-actions

Copy link
Copy Markdown

📚 Python docs preview for this PR

@MLopez-Ibanez
MLopez-Ibanez force-pushed the contrib/moocore-19-ty-check branch 3 times, most recently from 46d7011 to e0da0c0 Compare October 25, 2026 16:23
 * .github/workflows/python.yml (type-check): New job.
 * .pre-commit-config.yaml (astral-sh/ty-pre-commit): New repo. Skip in pre-commit.ci
 * python/src/moocore/_docsubstitute.py (CallableT): New TypeVar.
 * python/src/moocore/_generate.py: Resolve ty diagnostics.
 * python/src/moocore/_moocore.py: Likewise.
   (MaximiseType): New TypeAlias.
 * python/src/moocore/_utils.py: Resolve ty diagnostics.
   Inputs of internal functions should be strict.
@MLopez-Ibanez
MLopez-Ibanez force-pushed the contrib/moocore-19-ty-check branch from e0da0c0 to 65b1032 Compare October 25, 2026 17:25
@MLopez-Ibanez
MLopez-Ibanez merged commit 3d650af into multi-objective:main Oct 26, 2026
26 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 26, 2026
@MLopez-Ibanez

Copy link
Copy Markdown
Contributor

@ZijunLee Thank you for the PR!

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