Skip to content

Do not ignore env.py fallbacks for empty variables in config.py #40388

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

antonio-rojas
Copy link
Contributor

If a variable is set to the empty string in config.py, consider the fallbacks defined in env.py

In particular, this fixes MATHJAX_DIR outside sage-the-distro

If a variable is set to the empty string in config.py, consider the fallbacks defined in env.py

In particular, this fixes MATHJAX_DIR outside sage-the-distro
@antonio-rojas
Copy link
Contributor Author

Before:

sage: sage.env.MATHJAX_DIR
''

After:

sage: sage.env.MATHJAX_DIR
'/usr/share/mathjax'

@antonio-rojas
Copy link
Contributor Author

The test failure in Conda (ubuntu, Python 3.12, new) is not new, it was also there the last time env.py was touched:

https://github.com/sagemath/sage/pull/40152/files

It's a # long time test so it's only run when the file is modified.

@tobiasdiez
Copy link
Contributor

I'm a bit torn. On the one hand this is a sensible, quick fix. On the other hand, I agree with your

In the long term we should fix the env.py/config.py duplication and centralize the variable settings and fallbacks in a single place.

Since with #39030, sage-the-distro uses the meson backend as well, we can already start this consolidation. So here I would propose to:

  • Detect Mathjax in meson, with fallback to the cdn, export to config.py
  • Remove Mathjax stuff from env.py
  • Directly use the Mathjax path as determined via meson in the doctest conf.py
  • Remove the Mathjax spkg

@antonio-rojas
Copy link
Contributor Author

antonio-rojas commented Jul 9, 2025

That sounds reasonable. My main concern is that it sounds like a big change and we are quite late in the 10.7 cycle, so I'm not sure it will make it on time. I was hoping to ship 10.7 built with meson and this fix is required to build docs in that case (of course I can always patch stuff downstream, but it's better not to have to).

@tobiasdiez
Copy link
Contributor

Okay, good point.

I've started working (or better let copilot work) on the matjax migration to meson config in #40404.

vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 14, 2025
sagemathgh-40388: Do not ignore env.py fallbacks for empty variables in config.py
    
If a variable is set to the empty string in config.py, consider the
fallbacks defined in env.py

In particular, this fixes MATHJAX_DIR outside sage-the-distro
    
URL: sagemath#40388
Reported by: Antonio Rojas
Reviewer(s):
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.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy