id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
29038 Python package sage_conf: Provides optional configuration information for sagelib mkoeppe "This ticket introduces a new Python package `sage_conf`.
- sage-the-distribution will generate this Python package at `./configure` time and install it at build time before starting to build/install sagelib using `src/setup.py`.
- Distributions will generate and install their own `sage_conf` by a method of their choice before starting to build/install sagelib.
A `console_script` allows to query individual variable values from the shell, or output all variables in .env format:
{{{
$ local/bin/sage-config MAXIMA
/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/local/bin/maxima
$ local/bin/sage-config
VERSION=9.1.beta0
MAXIMA=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/local/bin/maxima
SAGE_LOCAL=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/local
SAGE_ROOT=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring
}}}
The module and the script are used as follows:
1. It provides configuration information to sagelib at installation time (`src/setup.py`).
Ultimately we want to be able to install sagelib with `pip`. To support installation by `pip` from PyPI, from an URL, etc., we cannot expect to configure the build like we do now, by writing the configuration to the file `src/sage-env-config`. Moreover, if pip is running in `--isolated` mode, also no environment variables are passed. Then the only information flow is through arguments to `pip build` and through the installed Python packages. By installing `sage_conf` first, we make the configuration available to the pip install of sagelib.
2. It provides configuration information to the docbuild, in particular about the install locations of documentation of external packages.
3. It provides configuration information to the runtime of sagelib, making sagelib more independent from the environment variables set by `src/bin/sage-env` (`local/bin/sage-env`).
a. By providing `SAGE_LOCAL` as one the configuration variables, it removes assumptions regarding install locations of `sagelib` relative to `$SAGE_LOCAL`. This enables the following:
- Installing an experimental version of `sagelib` in other install locations, such as in a user site packages directory.
- Making `sagelib` available in a user's venv, as in the following example:
Without this ticket:
{{{
$ sage -python -m venv --system-site-packages ~/personal-sage-venv/
$ source ~/personal-sage-venv/bin/activate
(personal-sage-venv) $ python
>>> import sage.env
>>> sage.env.SAGE_LOCAL
'/Users/mkoeppe/personal-sage-venv' # wrong
>>> import sage.all
RuntimeError: You must get the file local/bin/sage-maxima.lisp
}}}
With this ticket:
{{{
>>> sage.env.SAGE_LOCAL
'/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/local'
>>> import sage.all
>>> sage.all.maxima('1')
1
}}}
- #29013/#27824: Using the system python3 via spkg-configure.m4
b. For a broader context: see #21707 Task: Split `sage-env` into 5
" enhancement closed major sage-9.1 build fixed fbissey arojas isuruf embray infinity0 gh-timokau jdemeyer dimpase jhpalmieri vbraun Matthias Koeppe Dima Pasechnik, Erik Bray N/A af18a01e25b70406cf5ea948f550493f065282ae