src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1#36218
Merged
vbraun merged 1 commit intosagemath:developfrom Sep 16, 2023
Merged
src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1#36218vbraun merged 1 commit intosagemath:developfrom
vbraun merged 1 commit intosagemath:developfrom
Conversation
Newer versions of debugpy come with a bundled pydevd that complains
about >=python-3.11's frozen core modules. This causes a doctest
failure,
File "sage/repl/ipython_kernel/kernel.py", line 48, in sage.repl.ipython_kernel.kernel.SageKernel.__init__
Failed example:
from sage.repl.ipython_kernel.kernel import SageKernel
Expected nothing
Got:
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
The issue is simply that, with the core modules frozen, the user
cannot place breakpoints in them. The warning however is displayed
whenever you import debugpy, which happens inside ipykernel,
i.e. whenever we merely import SageKernel.
Taking the warning's advice, we set PYDEVD_DISABLE_FILE_VALIDATION=1
in src/bin/sage-env to hide the untimely warning. This does nothing to
change the status quo (you couldn't put breakpoints in frozen modules
before and now you still can't), but it fixes the doctest failure
and makes the old/new versions of debugpy behave consistently.
|
Documentation preview for this PR (built with commit 31a764f; changes) is ready! 🎉 |
mkoeppe
approved these changes
Sep 8, 2023
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Sep 11, 2023
sagemathgh-36218: src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1 This fixes a doctest with newer versions of debugpy, as seen in in sagemath#36141 and sagemath#36129. Explanation in the commit message. URL: sagemath#36218 Reported by: Michael Orlitzky Reviewer(s): Matthias Köppe
vbraun
pushed a commit
to vbraun/sage
that referenced
this pull request
Sep 14, 2023
sagemathgh-36218: src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1 This fixes a doctest with newer versions of debugpy, as seen in in sagemath#36141 and sagemath#36129. Explanation in the commit message. URL: sagemath#36218 Reported by: Michael Orlitzky Reviewer(s): Matthias Köppe
13 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes a doctest with newer versions of debugpy, as seen in in #36141 and #36129. Explanation in the commit message.