sage icon indicating copy to clipboard operation
sage copied to clipboard

Meson build: `sage_getsource.sageinspect` doesn't work due to missing sources

Open antonio-rojas opened this issue 8 months ago • 2 comments

Steps To Reproduce

Tests in sage.misc.sageinspect are failing due to missing sources. There is the issue, already reported in https://github.com/sagemath/sage/issues/39735, that the absolute path of the sources is embedded at build time. But even after this is fixed, tests will still fail in a packaged sage if cython sources are not shipped.

IMO sources should be included in the wheel: this software is mostly used by mathematicians for which inspecting the implementation details may be of interest, even if they are not developers. Ipython provides a very convenient UI for doing that, and if would be nice for this to work for compiled as well as non-compiled modules. But if it is decided that they will not be shipped, these tests should be gracefully skipped (maybe with a new #sources tag)

Expected Behavior

No test failures

Actual Behavior

$ python -m sage.doctest --long sage/src/sage/misc/sageinspect.py
[...]
**********************************************************************
5 items had failures:
   3 of  27 in sage.misc.sageinspect
   2 of  26 in sage.misc.sageinspect.__internal_tests
   1 of  48 in sage.misc.sageinspect.sage_getargspec
   2 of   7 in sage.misc.sageinspect.sage_getfile_relative
   6 of  31 in sage.misc.sageinspect.sage_getsourcelines
    [356 tests, 14 failures, 20.33s wall]
----------------------------------------------------------------------
sage -t --long --warn-long 30.0 --random-seed=4903767262386099346921216050020413248 sage/src/sage/misc/sageinspect.py  # 14 doctests failed
----------------------------------------------------------------------

Additional Information

No response

Environment

  • OS: Arch Linux
  • Sage Version: 10.7.beta0

Checklist

  • [x] I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • [x] I have read the documentation and troubleshoot guide

antonio-rojas avatar Apr 04 '25 19:04 antonio-rojas

I don't have a strong opinion about shipping sources or not. Do you know how numpy/scipy are handling this?

tobiasdiez avatar May 10 '25 04:05 tobiasdiez

I don't have a strong opinion about shipping sources or not. Do you know how numpy/scipy are handling this?

They don't install the pyx sources AFAICS (but also sageinspect tests doesn't expect them)

antonio-rojas avatar May 18 '25 08:05 antonio-rojas

Fixed by #40686?

tobiasdiez avatar Aug 30 '25 11:08 tobiasdiez

Fixed by #40686?

As far as sage is concerned yes, but that won't do anything until the cython part of the fix is merged.

antonio-rojas avatar Aug 30 '25 13:08 antonio-rojas