File: 0003-Avoid-hard-dependency-on-libcst.patch

package info (click to toggle)
python-hypothesis 6.138.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 15,272 kB
  • sloc: python: 62,853; ruby: 1,107; sh: 253; makefile: 41; javascript: 6
file content (33 lines) | stat: -rw-r--r-- 1,022 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
27
28
29
30
31
32
33
From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Tue, 29 Aug 2023 10:58:19 +0200
Subject: Avoid hard dependency on libcst

Forwarded: not-needed
---
 hypothesis-python/docs/conf.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/hypothesis-python/docs/conf.py b/hypothesis-python/docs/conf.py
index 40d93b1..da8a77a 100644
--- a/hypothesis-python/docs/conf.py
+++ b/hypothesis-python/docs/conf.py
@@ -108,12 +108,15 @@ def setup(app):
         app.tags.add("has_release_file")
 
     # Workaround for partial-initialization problem when autodoc imports libcst
-    import libcst
+    try:
+        import libcst
 
-    import hypothesis.extra.codemods
+        import hypothesis.extra.codemods
 
-    assert libcst
-    assert hypothesis.extra.codemods
+        assert libcst
+        assert hypothesis.extra.codemods
+    except ModuleNotFoundError:
+        pass
 
     # patch in mock array_api namespace so we can autodoc it
     from hypothesis.extra.array_api import (