Skip to content

chore: replace custom sort postprocess with keep_model_order config#734

Merged
vdusek merged 1 commit intomasterfrom
chore/use-keep-model-order-config
Apr 17, 2026
Merged

chore: replace custom sort postprocess with keep_model_order config#734
vdusek merged 1 commit intomasterfrom
chore/use-keep-model-order-config

Conversation

@vdusek
Copy link
Copy Markdown
Contributor

@vdusek vdusek commented Apr 17, 2026

Summary

  • Enables keep_model_order = true in [tool.datamodel-codegen] config.
  • Removes the custom sort_classes postprocess step and its 16 unit tests.
  • Verified by regenerating src/apify_client/_models.py — zero diff vs. the previous custom-sort output.

datamodel-code-generator's built-in --keep-model-order already does a topological sort with class-name ordering, which is equivalent to what our custom script was doing. Discussed with the maintainer in koxudaxi/datamodel-code-generator#3087.

datamodel-code-generator's built-in --keep-model-order already performs
topological sort with class-name ordering, producing identical output to
our custom alphabetizer. Enabling it in pyproject.toml lets us drop the
sort_classes postprocess step and its tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Apr 17, 2026
@vdusek vdusek self-assigned this Apr 17, 2026
@vdusek vdusek requested a review from Pijukatel April 17, 2026 07:04
@github-actions github-actions bot added this to the 138th sprint - Tooling team milestone Apr 17, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.42%. Comparing base (1a2b642) to head (9e8f227).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #734      +/-   ##
==========================================
+ Coverage   95.38%   95.42%   +0.03%     
==========================================
  Files          45       45              
  Lines        5115     5115              
==========================================
+ Hits         4879     4881       +2     
+ Misses        236      234       -2     
Flag Coverage Δ
integration 95.42% <ø> (+0.03%) ⬆️

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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek vdusek merged commit 3d4ce3f into master Apr 17, 2026
26 checks passed
@vdusek vdusek deleted the chore/use-keep-model-order-config branch April 17, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants