Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/bin/sage-env: set PYDEVD_DISABLE_FILE_VALIDATION=1 #36218

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Sep 8, 2023

This fixes a doctest with newer versions of debugpy, as seen in in #36141 and #36129. Explanation in the commit message.

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.
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

Documentation preview for this PR (built with commit 31a764f; changes) is ready! 🎉

vbraun pushed a commit to vbraun/sage that referenced this pull request Sep 11, 2023
    
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
    
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 vbraun merged commit 3ea9617 into sagemath:develop Sep 16, 2023
16 of 22 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Sep 16, 2023
@orlitzky orlitzky deleted the new-debugpy branch September 22, 2023 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants