forked from sagemath/sage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sagemathgh-37024: Access database and other files through features, f…
…or simpler configuration This PR reworks the way sagemath access database files, and some other external files. The end result is that the runtime detection of databases as features matches exactly what will be used. Moreover, this leads to an easy implementation of search paths, meaning we don't need configuration as long as the files are in a few standard system locations. Notes on implementation: - First every user of these files access them via features, and never directly through `sage.env`, since the former is dynamic and the latter is static. - Then we add a variable `SAGE_DATA_PATH` which is a colon separated search path for databases. The default should work for sage-the-distro and most distros (think `/usr/share/sagemath:/usr/share` for a system install on `/usr`). - Now a database, say `cremona` is searched on `$p/cremona` for each `$p` in `SAGE_DATA_PATH`. - I also added `$DOT_SAGE/db` first in the search path, this makes it easy for a user to install a missing database (or update an old one). - Finally, as an example I did something similar to find `JmolData.jar` and `three.min.js`. The former is searched in `$SAGE_SHARE/sagemath/jmol` and `$SAGE_SHARE/jmol` and the latter also in `$SAGE_SHARE/jupyter/nbextensions/threejs-sage` which seems to make sense. Other files can be done later (e.g. mathjax). In principle anything that has a default value in `sage.env` or `sage_conf` should benefit from using a search path and removing the default value. With this PR, I can run stock sagemath without any `sage_conf.py`. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have created tests covering the changes. ### ⌛ Dependencies URL: sagemath#37024 Reported by: Gonzalo Tornaría Reviewer(s): François Bissey, Gonzalo Tornaría, Matthias Köppe, Michael Orlitzky
- Loading branch information
Showing
19 changed files
with
896 additions
and
125 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.