-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33029: Feature and doctest tag for runtime cython
While updating the sagemath Debian package I noticed that when running the doctests for the installed sagemath package I get many failing tests such as the one below if library development files are not installed (in the example libm4ri-dev is not installed). The sagemath packages should not depend on lib*-dev packages, but sagemath is looking for pkgconfig files which are in these packages. Could this check for pkgconfig files in the test suite be avoided? {{{ sage -t --long --random-seed=0 sage/src/sage/arith/long.pxd ********************************************************************** File "sage/src/sage/arith/long.pxd", line 116, in sage.arith.long.integer_check_long Failed example: cython(''' from sage.arith.long cimport * from sage.rings.integer cimport smallInteger def check_long(x): cdef long value cdef int err cdef bint c = integer_check_long(x, &value, &err) if c: if err == 0: return value elif err == ERR_OVERFLOW: raise OverflowError("integer_check_long: overflow") elif err == ERR_TYPE: raise TypeError("integer_check_long: wrong type") elif err == ERR_INDEX: raise TypeError("integer_check_long: bad __index__") assert False from libc.limits cimport LONG_MIN, LONG_MAX def long_min(): return smallInteger(LONG_MIN) def long_max(): return smallInteger(LONG_MAX) ''') Exception raised: Traceback (most recent call last): File "sage/misc/cachefunc.pyx", line 996, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:5970) return self.cache[k] KeyError: ((), ()) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/sage/doctest/forker.py", line 718, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/lib/python3/dist-packages/sage/doctest/forker.py", line 1137, in compile_and_execute exec(compiled, globs) File "<doctest sage.arith.long.integer_check_long[0]>", line 1, in <module> cython(''' File "sage/misc/lazy_import.pyx", line 362, in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:4049) return self.get_object()(*args, **kwds) File "/usr/lib/python3/dist-packages/sage/misc/cython.py", line 661, in cython_compile return cython_import_all(tmpfile, get_globals(), **kwds) File "/usr/lib/python3/dist-packages/sage/misc/cython.py", line 551, in cython_import_all m = cython_import(filename, **kwds) File "/usr/lib/python3/dist-packages/sage/misc/cython.py", line 526, in cython_import name, build_dir = cython(filename, **kwds) File "/usr/lib/python3/dist-packages/sage/misc/cython.py", line 284, in cython standard_libs, standard_libdirs, standard_includes, aliases = _standard_libs_libdirs_incdirs_aliases() File "sage/misc/cachefunc.pyx", line 1001, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:6098) w = self.f(*args, **kwds) File "/usr/lib/python3/dist-packages/sage/misc/cython.py", line 50, in _standard_libs_libdirs_incdirs_aliases aliases = cython_aliases() File "/usr/lib/python3/dist-packages/sage/env.py", line 475, in cython_aliases aliases[var + "CFLAGS"] = pkgconfig.cflags(lib).split() File "/usr/lib/python3/dist-packages/pkgconfig/pkgconfig.py", line 144, in cflags _raise_if_not_exists(package) File "/usr/lib/python3/dist-packages/pkgconfig/pkgconfig.py", line 103, in _raise_if_not_exists raise PackageNotFoundError(package) pkgconfig.pkgconfig.PackageNotFoundError: m4ri not found }}} URL: https://trac.sagemath.org/33029 Reported by: thansen Ticket author(s): Matthias Koeppe Reviewer(s): Sébastien Labbé
- Loading branch information
Showing
27 changed files
with
212 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
r""" | ||
Features for testing the presence of ``cython`` | ||
""" | ||
|
||
from . import CythonFeature | ||
|
||
|
||
class sage__misc__cython(CythonFeature): | ||
r""" | ||
A :class:`~sage.features.Feature` which describes whether :mod:`sage.misc.cython` | ||
is available and functional. | ||
""" | ||
def __init__(self): | ||
r""" | ||
TESTS:: | ||
sage: from sage.features import CythonFeature | ||
sage: from sage.features.cython import sage__misc__cython | ||
sage: isinstance(sage__misc__cython(), CythonFeature) | ||
True | ||
""" | ||
# It suffices to use a trivial CythonFeature because CythonFeature | ||
# is implemented via sage.misc.cython. | ||
CythonFeature.__init__(self, "sage.misc.cython", test_code="") | ||
|
||
|
||
def all_features(): | ||
return [sage__misc__cython()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.