File: 0008-Fix-unsorted-css-for-reproductibility.patch

package info (click to toggle)
sphinx-needs 5.1.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,056 kB
  • sloc: python: 21,148; javascript: 187; makefile: 93; sh: 29; xml: 10
file content (26 lines) | stat: -rw-r--r-- 1,214 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Christian Bayle <bayle@debian.org>
Date: Wed, 17 Sep 2025 12:25:21 +0200
Subject: Fix unsorted css for reproductibility

---
 sphinx_needs/environment.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sphinx_needs/environment.py b/sphinx_needs/environment.py
index aae33af..e0e774a 100644
--- a/sphinx_needs/environment.py
+++ b/sphinx_needs/environment.py
@@ -57,11 +57,11 @@ def install_styles_static_files(app: Sphinx, env: BuildEnvironment) -> None:
         str(dest_dir.joinpath("common_css")),
         lambda path: not path.endswith(".css"),
     )
-    for common_path in dest_dir.joinpath("common_css").glob("*.css"):
+    for common_path in sorted(dest_dir.joinpath("common_css").glob("*.css")):
         _add_css_file(app, common_path.relative_to(statics_dir))
 
     # Add theme css file
-    if config.css in [f.name for f in css_root.joinpath("themes").glob("*.css")]:
+    if config.css in [f.name for f in sorted(css_root.joinpath("themes").glob("*.css"))]:
         copy_asset_file(str(css_root.joinpath("themes", config.css)), str(dest_dir))
         _add_css_file(app, dest_dir.joinpath(config.css).relative_to(statics_dir))
     elif Path(config.css).is_file():