From 068dd5dbe6ec478a59fe29221ba9d0019e2f9c1d Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Tue, 26 May 2026 11:17:48 +0200 Subject: [PATCH] Stabilize python module order in typedoc snapshots --- src/plugin/python/transformation.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugin/python/transformation.ts b/src/plugin/python/transformation.ts index b1e22c0..9e469e0 100644 --- a/src/plugin/python/transformation.ts +++ b/src/plugin/python/transformation.ts @@ -150,8 +150,12 @@ export class DocspecTransformer { docspecModules as unknown as { name: string }, ); + // Sort modules by name so the sequential IDs assigned by `SymbolIdTracker` are deterministic across + // runs (`PythonLoader` traversal order is filesystem-dependent and reshuffles IDs across CI machines). + const sortedModules = [...docspecModules].sort((a, b) => a.name.localeCompare(b.name)); + // Convert all the modules, store them in the root object - for (const module of docspecModules) { + for (const module of sortedModules) { this.walkAndTransform({ currentDocspecNode: module, moduleName: module.name,