Commit 57e59d3
authored
Fix: Ensure deterministic file ordering in
### Summary
Fixed non-deterministic file ordering in the `iter_package_files` function by adding explicit sorting of package files. This change ensures consistent behavior across builds and prevents issues caused by unordered file iteration.
### Changes Made
- Applied `sorted()` to file listings in both Python versions (<3.11 and >=3.11).
- Guaranteed that files are processed in a consistent, lexicographic order.
### Why This Fix?
- Prevents non-deterministic builds caused by unordered file iteration.
- Improves build reproducibility and enables better caching in CI/CD pipelines.
- Simplifies code by enforcing consistent ordering within the function, reducing the need for manual sorting in callers.
### Testing
- Rebuilt the project multiple times and verified that output files are now consistent across builds.
- Compared generated artifacts (e.g., `.json` files) to confirm deterministic ordering.
### Impact
- No functional changes to how files are processed, only improves determinism.
- Safer and more reliable builds, especially in CI environments.
Closes #265iter_package_files (#269)1 parent a353d10 commit 57e59d3
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments