My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/applications/science/math/sage/patches/Only-test-external-software...

46 lines
2.1 KiB

diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index 01f32fb8e4..4d83dc7b47 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -1253,6 +1253,7 @@ class DocTestController(SageObject):
self.log("Using --optional=" + self._optional_tags_string())
available_software._allow_external = self.options.optional is True or 'external' in self.options.optional
+ available_software._autodetect_safe = self.options.optional is True or 'sage' in self.options.optional
self.log("Features to be detected: " + ','.join(available_software.detectable()))
self.add_files()
self.expand_files_into_sources()
diff --git a/src/sage/doctest/external.py b/src/sage/doctest/external.py
index 84dae19ea5..badc61466e 100644
--- a/src/sage/doctest/external.py
+++ b/src/sage/doctest/external.py
@@ -409,6 +409,7 @@ class AvailableSoftware(object):
[]
"""
self._allow_external = True
+ self._autodetect_safe = True
# For multiprocessing of doctests, the data self._seen should be
# shared among subprocesses. Thus we use Array class from the
# multiprocessing module.
@@ -430,6 +431,8 @@ class AvailableSoftware(object):
sage: 'internet' in available_software # random, optional - internet
True
"""
+ if not self._autodetect_safe:
+ return False
try:
idx = self._indices[item]
except KeyError:
diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py
index 433338766d..233623b14a 100644
--- a/src/sage/features/sagemath.py
+++ b/src/sage/features/sagemath.py
@@ -12,7 +12,7 @@ class sagemath_doc_html(StaticFile):
EXAMPLES::
- sage: from sage.features.sagemath import sagemath_doc_html
+ sage: from sage.features.sagemath import sagemath_doc_html # optional - sagemath_doc_html
sage: sagemath_doc_html().is_present() # optional - sagemath_doc_html
FeatureTestResult('sagemath_doc_html', True)
"""