Opened 21 months ago

Last modified 20 months ago

#29038 closed enhancement

Python package sage_conf: Provides optional configuration information for sagelib — at Version 11

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.1
Component: build Keywords:
Cc: fbissey, arojas, isuruf, embray, infinity0, gh-timokau, jdemeyer, dimpase, jhpalmieri, vbraun Merged in:
Authors: Matthias Koeppe Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mkoeppe/python_package_sage_conf__provides_optional_configuration_information_for_sagelib (Commits, GitHub, GitLab) Commit: 88fd03c7784eb82eeb8cb06102ed4e93f5f1d758
Dependencies: Stopgaps:

Status badges

Description (last modified by 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).
  1. It provides configuration information to the docbuild, in particular about the install locations of documentation of external packages.
  1. 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).
  1. 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
  1. For a broader context: see #21707 Task: Split sage-env into 5

Change History (11)

comment:1 Changed 21 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Description modified (diff)

comment:2 Changed 21 months ago by mkoeppe

  • Branch set to u/mkoeppe/python_package_sage_conf__provides_optional_configuration_information_for_sagelib

comment:3 Changed 21 months ago by mkoeppe

  • Cc fbissey arojas isuruf embray infinity0 gh-timokau jdemeyer dimpase jhpalmieri added
  • Commit set to fe5c890e66a7dd37395720b6c8e08a3837e5a74d
  • Status changed from new to needs_review

New commits:

fe5c89029038: Python package sage_conf: Provides configuration information for sagelib

comment:4 Changed 21 months ago by git

  • Commit changed from fe5c890e66a7dd37395720b6c8e08a3837e5a74d to aefd827981481f015c696328402278f2f8d30912

Branch pushed to git repo; I updated commit sha1. New commits:

aefd827build/pkgs/sage_conf/spkg-install: Fix up path

comment:5 Changed 21 months ago by dimpase

why are you checking in files which apparently are meant to be generated from .in templates?

comment:6 Changed 21 months ago by mkoeppe

A mistake, which I will fix in a moment. Thanks!

comment:7 Changed 21 months ago by git

  • Commit changed from aefd827981481f015c696328402278f2f8d30912 to 88fd03c7784eb82eeb8cb06102ed4e93f5f1d758

Branch pushed to git repo; I updated commit sha1. New commits:

981e864Move .gitignore to the right place, remove generated files
88fd03cAdd console_scripts entry_point sage-config

comment:8 Changed 21 months ago by mkoeppe

  • Description modified (diff)

comment:9 Changed 20 months ago by mkoeppe

  • Description modified (diff)

comment:10 Changed 20 months ago by mkoeppe

  • Description modified (diff)

comment:11 Changed 20 months ago by mkoeppe

  • Description modified (diff)
Note: See TracTickets for help on using tickets.