Skip to content

feat(backend): add typechecking with ty #9664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

matmair
Copy link
Contributor

@matmair matmair commented May 15, 2025

Adds type checking via astral's (experimental) ty which is pretty fast.
This is technically done but I will keep it as draft till we have 1.0 out to stop an accidential merge

Copy link

netlify bot commented May 15, 2025

Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 7bd98cd
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6830efe61c5845000983d0cd

Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 92.71255% with 18 lines in your changes missing coverage. Please review.

Project coverage is 86.29%. Comparing base (3d71be3) to head (7bd98cd).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...rc/backend/InvenTree/report/templatetags/report.py 57.14% 6 Missing ⚠️
src/backend/InvenTree/InvenTree/settings.py 77.77% 2 Missing ⚠️
src/backend/InvenTree/plugin/registry.py 81.81% 2 Missing ⚠️
src/backend/InvenTree/InvenTree/permissions.py 0.00% 1 Missing ⚠️
src/backend/InvenTree/InvenTree/serializers.py 66.66% 1 Missing ⚠️
src/backend/InvenTree/InvenTree/sso.py 0.00% 1 Missing ⚠️
src/backend/InvenTree/InvenTree/tracing.py 0.00% 1 Missing ⚠️
...Tree/company/migrations/0019_auto_20200413_0642.py 0.00% 1 Missing ⚠️
src/backend/InvenTree/generic/states/transition.py 91.66% 1 Missing ⚠️
src/backend/InvenTree/plugin/plugin.py 83.33% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9664      +/-   ##
==========================================
- Coverage   86.35%   86.29%   -0.06%     
==========================================
  Files        1229     1229              
  Lines       53966    54070     +104     
  Branches     2259     2259              
==========================================
+ Hits        46601    46660      +59     
- Misses       6793     6838      +45     
  Partials      572      572              
Flag Coverage Δ
backend 88.33% <92.71%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matmair matmair self-assigned this May 17, 2025
@matmair matmair added this to the 2.0.0 milestone May 17, 2025
@matmair matmair added the CI CI / unit testing ecosystem label May 17, 2025
@matmair
Copy link
Contributor Author

matmair commented May 17, 2025

@wolflu05 would appreciate a look and feedback on the approach

@wolflu05
Copy link
Member

Seems like only a small tool change. Looks good in general. The only I idea I have regarding mixins is to use the cast function from typing, but I am not sure if thats a good solution long term.

@matmair matmair marked this pull request as ready for review May 23, 2025 19:21
@matmair matmair requested a review from SchrodingersGat as a code owner May 23, 2025 19:21
@matmair matmair marked this pull request as draft May 23, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI / unit testing ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants