sagemath/sage

pip-installable version of package sage_conf - installs non-Python bits of the Sage distribution in ~/.sage/

Closed this issue · 227 comments

As #30913 makes sage-conf both (a) a PEP517/518 build_system requires and (b) an install-requires of sagelib (sagemath-standard), also a version of sage-conf must be made available on PyPI.

This version of sage-conf includes a copy of SAGE_ROOT and SAGE_ROOT/build/** in its source distribution. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in ~/.sage/ by running configure and make build-local; and then installs the configured sage_conf.py (#29038) as a Python module (and sage-config, sage-env-config).

There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing (the non-Python bits of) Sage-the-distribution. It may be useful for some users who wish to use pip to install everything they need.

To test:

./bootstrap && (cd pkgs/sage-conf_pypi/ && tox -r -v -v -v)

This test using tox uses .sage in an isolated directory within .tox instead of in your home directory. At the end of the tox run, the installed sage-config script is executed; it prints the configuration variables:

[10639] /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/pkgs/sage-conf_pypi$ /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/pkgs/sage-conf-pypi/.tox/python/bin/sage-config
VERSION=9.3.beta7
MAXIMA=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/bin/maxima
ARB_LIBRARY=arb
SAGE_NAUTY_BINS_PREFIX=
CBLAS_PC_MODULES=cblas
MATHJAX_DIR=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/share/mathjax
THREEJS_DIR=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/share/threejs
SAGE_LOCAL=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local
SAGE_ROOT=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin
python finish: run-test  after 0.17 seconds

To build a source distribution:

./sage -sh -c build/pkgs/sage_conf/spkg-src

(The source distribution has been uploaded to https://pypi.org/project/sage-conf/)

Follow-up steps:

  • Make SAGE_ROOT configurable by the user (by passing --prefix to setup.py).
  • Optionally, it would create a venv that is used for building wheels.
  • #30036: Make the build more incremental: On installation of sage-conf, only run configure but do not install anything; rather, a Python entry point can be used by Python distribution packages such as sagemath-standard to install packages if present.

CC: @jhpalmieri @dimpase @kiwifb @vbraun

Component: build

Keywords: sd111

Author: Matthias Koeppe

Branch: 2a4a323

Reviewer: Dima Pasechnik, François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/29039

Description changed:

--- 
+++ 
@@ -2,5 +2,5 @@
 
 It establishes a python-less SAGE_LOCAL hierarchy in the installed `package_data` of a new Python package `sage_local`.
 
-It also installs `sage_conf.py` (#29038) to enable installing a sagelib using that SAGE_LOCAL>
+It also installs `sage_conf.py` (#29038) to enable installing a sagelib using that SAGE_LOCAL.
 

Description changed:

--- 
+++ 
@@ -1,6 +1,6 @@
 This provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need.
 
-It establishes a python-less SAGE_LOCAL hierarchy in the installed `package_data` of a new Python package `sage_local`.
+It establishes a python-less SAGE_LOCAL hierarchy in the installed `package_data` of the Python package `sage_bootstrap`.  The installed script `build/bin/sage-site` can be used by Python packages such as `sagelib` to install additional packages.
 
-It also installs `sage_conf.py` (#29038) to enable installing a sagelib using that SAGE_LOCAL.
+It also installs `build/sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL.
 

Description changed:

--- 
+++ 
@@ -4,3 +4,11 @@
 
 It also installs `build/sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL.
 
+Steps:
+- Move `configure.ac`, `m4`, `config` into `build/`.  
+- Leave behind a symlink `configure -> build/configure`. 
+- Split out `build/bootstrap` from `SAGE_ROOT/bootstrap`, call it from there.
+- Extend `build/MANIFEST.in` to include all files in `build`, including `build/pkgs` and `build/make` 
+- An sdist of `sage_bootstrap` will contain `configure`, just as an sdist of `sage_doc` will contain the files generated by `src/doc/bootstrap`. 
+- Exclude the symlinked `build/pkgs/sagelib/src/`, probably exclude all Python spkgs. 
+

Dependencies: #30025

Description changed:

--- 
+++ 
@@ -5,9 +5,7 @@
 It also installs `build/sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL.
 
 Steps:
-- Move `configure.ac`, `m4`, `config` into `build/`.  
-- Leave behind a symlink `configure -> build/configure`. 
-- Split out `build/bootstrap` from `SAGE_ROOT/bootstrap`, call it from there.
+- #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
 - Extend `build/MANIFEST.in` to include all files in `build`, including `build/pkgs` and `build/make` 
 - An sdist of `sage_bootstrap` will contain `configure`, just as an sdist of `sage_doc` will contain the files generated by `src/doc/bootstrap`. 
 - Exclude the symlinked `build/pkgs/sagelib/src/`, probably exclude all Python spkgs. 

New commits:

6e28ae5Add sage_root to sage_bootstrap

Commit: 6e28ae5

Description changed:

--- 
+++ 
@@ -1,8 +1,12 @@
 This provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need.
 
-It establishes a python-less SAGE_LOCAL hierarchy in the installed `package_data` of the Python package `sage_bootstrap`.  The installed script `build/bin/sage-site` can be used by Python packages such as `sagelib` to install additional packages.
+It establishes a python-less SAGE_LOCAL hierarchy either in the installed `package_data` of the Python package `sage_bootstrap`, or in `~/.sage/`, or something configured by the user (by passing `--prefix` to `setup.py`).  On installation, it only runs `configure` but does not install anything. By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
 
-It also installs `build/sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL.
+A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
+
+It also installs `sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL. (Or there could be a different installed configuration module such as `sage_bootstrap.config`.)
+
+
 
 Steps:
 - #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`

Changed commit from 6e28ae5 to a6373b7

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

a6373b7build/setup.py: Add sage_root as package_data

Changed commit from a6373b7 to b0ddab0

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

441cb6eWorking sdist and install
b0ddab0Simplify directory structure

Changed dependencies from #30025 to #30025, #29850

Changed commit from b0ddab0 to 60642d3

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

10f4fbebuild/setup.py: Reuse configured sage root
733427cRe-add build/sage_root
60642d3build/setup.py: Install sage_conf.py, sage-env-config

Description changed:

--- 
+++ 
@@ -4,7 +4,7 @@
 
 A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
 
-It also installs `sage_conf.py` (#29038) as a Python module to enable installing a sagelib using that SAGE_LOCAL. (Or there could be a different installed configuration module such as `sage_bootstrap.config`.)
+It also installs `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`) to enable installing a sagelib using that `SAGE_LOCAL`. 
 
 
 

Changed dependencies from #30025, #29850 to #30025

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

8006b6fAdd sage_bootstrap.build

Changed commit from 60642d3 to 8006b6f

Work Issues: sage-system-python in installed sage_bootstrap

Author: Matthias Koeppe

Changed dependencies from #30025 to #30025, #30527

Description changed:

--- 
+++ 
@@ -1,6 +1,9 @@
 This provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need.
 
-It establishes a python-less SAGE_LOCAL hierarchy either in the installed `package_data` of the Python package `sage_bootstrap`, or in `~/.sage/`, or something configured by the user (by passing `--prefix` to `setup.py`).  On installation, it only runs `configure` but does not install anything. By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
+It establishes a python-less SAGE_LOCAL hierarchy either in the installed `package_data` of the Python package `sage_bootstrap`, or in `~/.sage/`, or something configured by the user (by passing `--prefix` to `setup.py`).  On installation, it only runs `configure` but does not install anything. 
+
+- By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
+- Optionally, it would create a venv that is used for building wheels (#30527). 
 
 A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
 

Changed dependencies from #30025, #30527 to #30025, #30527, #29013

Description changed:

--- 
+++ 
@@ -4,6 +4,7 @@
 
 - By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
 - Optionally, it would create a venv that is used for building wheels (#30527). 
+- Using #29013, it could support several python versions
 
 A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
 

Changed dependencies from #30025, #30527, #29013 to #30527, #29013

Description changed:

--- 
+++ 
@@ -13,7 +13,7 @@
 
 
 Steps:
-- #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
+- Optional: #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
 - Extend `build/MANIFEST.in` to include all files in `build`, including `build/pkgs` and `build/make` 
 - An sdist of `sage_bootstrap` will contain `configure`, just as an sdist of `sage_doc` will contain the files generated by `src/doc/bootstrap`. 
 - Exclude the symlinked `build/pkgs/sagelib/src/`, probably exclude all Python spkgs. 

Changed dependencies from #30527, #29013 to none

Changed commit from 8006b6f to 9293ae1

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

a1ad0beAdd sage_root to sage_bootstrap
8695368build/setup.py: Add sage_root as package_data
cc93ecaWorking sdist and install
45c0ebeSimplify directory structure
62d4f6cbuild/setup.py: Reuse configured sage root
7d705e3Re-add build/sage_root
44e3224build/setup.py: Install sage_conf.py, sage-env-config
9293ae1Add sage_bootstrap.build

Changed commit from 9293ae1 to 3f243e1

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

05c44c8build/sage_root: Remove outdated symlink
3f243e1build/setup.py: Use configure --with-python=...

Changed keywords from none to sd111

Description changed:

--- 
+++ 
@@ -8,8 +8,11 @@
 
 A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
 
+
 It also installs `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`) to enable installing a sagelib using that `SAGE_LOCAL`. 
 
+
+As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires`, also a version of `sage_conf` must be made available on PyPI.
 
 
 Steps:

Dependencies: #30913

Changed work issues from sage-system-python in installed sage_bootstrap to sage-system-python in installed sage_bootstrap. Rework it so that sage_conf is the package running configure.

Branch pushed to git repo; I updated commit sha1. This was a forced push. Last 10 new commits:

7da13f4Add sage_root to sage_bootstrap
9ea9d80build/setup.py: Add sage_root as package_data
3f5c99cWorking sdist and install
1f7647fSimplify directory structure
f59d077build/setup.py: Reuse configured sage root
4a18b98Re-add build/sage_root
8e44d28build/setup.py: Install sage_conf.py, sage-env-config
86e21a1Add sage_bootstrap.build
47f5e95build/sage_root: Remove outdated symlink
b7cd894build/setup.py: Use configure --with-python=...

Changed commit from 3f243e1 to b7cd894

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

4ff9371Move installation of SAGE_ROOT from sage_bootstrap to sage_conf (pypi version)
44b873bPut both versions of sage_conf sources into subdirectories of SAGE_ROOT/src/pkgs/

Changed commit from b7cd894 to 44b873b

Changed dependencies from #30913 to #30913, #31362

Description changed:

--- 
+++ 
@@ -1,23 +1,18 @@
-This provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need.
+As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
 
-It establishes a python-less SAGE_LOCAL hierarchy either in the installed `package_data` of the Python package `sage_bootstrap`, or in `~/.sage/`, or something configured by the user (by passing `--prefix` to `setup.py`).  On installation, it only runs `configure` but does not install anything. 
+This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it runs `configure` and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
+
+There no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
+
+It establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` or something configured by the user (by passing `--prefix` to `setup.py`).  
 
 - By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
 - Optionally, it would create a venv that is used for building wheels (#30527). 
 - Using #29013, it could support several python versions
 
-A Python entry point in `sage_bootstrap` can be used by Python packages such as `sagelib` to install packages if present.
+Steps:
+- Optional: #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
+- Exclude the symlinked `build/pkgs/sagelib/src/` via `MANIFEST.in`
+- Make the build more incremental: On installation of `sage_conf`,  only run `configure` but do not install anything; rather, a Python entry point can be used by Python packages such as `sagemath-standard` to install packages if present.
 
 
-It also installs `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`) to enable installing a sagelib using that `SAGE_LOCAL`. 
-
-
-As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires`, also a version of `sage_conf` must be made available on PyPI.
-
-
-Steps:
-- Optional: #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
-- Extend `build/MANIFEST.in` to include all files in `build`, including `build/pkgs` and `build/make` 
-- An sdist of `sage_bootstrap` will contain `configure`, just as an sdist of `sage_doc` will contain the files generated by `src/doc/bootstrap`. 
-- Exclude the symlinked `build/pkgs/sagelib/src/`, probably exclude all Python spkgs. 
-

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

8ee9087Put both versions of sage_conf sources into subdirectories of SAGE_ROOT/src/pkgs/

Changed commit from 44b873b to 8ee9087

Changed commit from 8ee9087 to 47e182d

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

47e182dPut both versions of sage_conf sources into subdirectories of SAGE_ROOT/src/pkgs/

Changed dependencies from #30913, #31362 to #30913, #31362, #31357

Changed commit from 47e182d to b2b785b

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

55bc2aam4/sage_spkg_collect.m4: Generate install tree information for build/make/Makefile
d7dc9a2build/make/Makefile.in: New targets all-sage-local, all-sage-venv
27b589bMerge branch 't/30912/sagelib__update_metadata_for_pypi_deployment' into t/31362/make_all_sage_local__make_all_sage_venv
8796008Put pynac into SAGE_LOCAL, sagelib into SAGE_VENV
d6831b1build/make/Makefile.in: Add all-build-local, all-build-venv, which include dependency on toolchain
61f6ba6Makefile: Add top-level targets build-local, build-venv
b2b785bPut both versions of sage_conf sources into subdirectories of SAGE_ROOT/src/pkgs/

Description changed:

--- 
+++ 
@@ -1,18 +1,22 @@
 As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
 
-This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it runs `configure` and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
+This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it runs `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
 
-There no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
+There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
 
-It establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` or something configured by the user (by passing `--prefix` to `setup.py`).  
+It establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/`.  
 
-- By default, instead of installing a copy of python3 or creating a venv, it would only run a python3 version check and would issue a warning if trying to install into a Python outside of the supported range.
+To test:
+
+```
+./bootstrap && (cd src/pkgs/sage_conf-pypi/ && MAKE="make -j12" tox -v -v -v)
+```
+
+
+Follow-up steps:
+- Make SAGE_ROOT configurable by the user (by passing `--prefix` to `setup.py`).
 - Optionally, it would create a venv that is used for building wheels (#30527). 
 - Using #29013, it could support several python versions
-
-Steps:
-- Optional: #30025: Clean up `SAGE_ROOT` directory by moving stuff into `SAGE_ROOT/build/`
-- Exclude the symlinked `build/pkgs/sagelib/src/` via `MANIFEST.in`
 - Make the build more incremental: On installation of `sage_conf`,  only run `configure` but do not install anything; rather, a Python entry point can be used by Python packages such as `sagemath-standard` to install packages if present.
 
 

Changed work issues from sage-system-python in installed sage_bootstrap. Rework it so that sage_conf is the package running configure. to none

Description changed:

--- 
+++ 
@@ -1,10 +1,8 @@
 As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
 
-This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it runs `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
+This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` by running `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
 
 There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
-
-It establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/`.  
 
 To test:
 

Changed dependencies from #30913, #31362, #31357 to #30913, #31362, #31357, #31321

Changed commit from b2b785b to b8b8a06

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

b8b8a06Put both versions of sage_conf sources into subdirectories of SAGE_ROOT/src/pkgs/

Changed commit from b8b8a06 to ff7f110

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

ff7f110build/pkgs/sage_conf/install-requires.txt: New

Changed commit from ff7f110 to 072b522

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

072b522Determine SAGE_ROOT from sage version and python version

Changed commit from 072b522 to fa4cbfa

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

fa4cbfaRun .homebrew-build-env and set 'make -j...' automatically

Description changed:

--- 
+++ 
@@ -1,15 +1,19 @@
 As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
 
-This version of `sage_conf` runs includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**`. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` by running `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
+This version of `sage_conf` includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**` in its source distribution. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` by running `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
 
 There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
 
 To test:
 
 ```
-./bootstrap && (cd src/pkgs/sage_conf-pypi/ && MAKE="make -j12" tox -v -v -v)
+./bootstrap && (cd src/pkgs/sage_conf-pypi/ && tox -v -v -v)
 ```
+To build a source distribution:
 
+```
+./sage -sh -c build/pkgs/sage_conf/spkg-src
+```
 
 Follow-up steps:
 - Make SAGE_ROOT configurable by the user (by passing `--prefix` to `setup.py`).

Description changed:

--- 
+++ 
@@ -2,13 +2,29 @@
 
 This version of `sage_conf` includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**` in its source distribution. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` by running `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
 
-There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing sage-the-distribution that may be useful for some users who wish to use `pip` to install everything they need. 
+There are no changes to how the Sage distribution is built. This ticket only provides an alternative and strictly optional way of installing (the non-Python bits of) Sage-the-distribution.  It may be useful for some users who wish to use `pip` to install everything they need. 
 
 To test:
 
 ```
 ./bootstrap && (cd src/pkgs/sage_conf-pypi/ && tox -v -v -v)
 ```
+This test using `tox` uses `.sage` in an isolated directory within `.tox` instead of in your home directory. At the end of the tox run, the installed `sage-config` script is executed; it prints the configuration variables:
+
+```
+[10639] /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi$ /Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/bin/sage-config
+VERSION=9.3.beta7
+MAXIMA=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/bin/maxima
+ARB_LIBRARY=arb
+SAGE_NAUTY_BINS_PREFIX=
+CBLAS_PC_MODULES=cblas
+MATHJAX_DIR=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/share/mathjax
+THREEJS_DIR=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local/share/threejs
+SAGE_LOCAL=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin/local
+SAGE_ROOT=/Users/mkoeppe/s/sage/sage-rebasing/worktree-algebraic-2018-spring/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.beta7-cpython-39-darwin
+python finish: run-test  after 0.17 seconds
+```
+
 To build a source distribution:
 
 ```

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

fa9485cRemove sage_bootstrap.build (not needed for this ticket)

Changed commit from fa4cbfa to fa9485c

Description changed:

--- 
+++ 
@@ -35,6 +35,6 @@
 - Make SAGE_ROOT configurable by the user (by passing `--prefix` to `setup.py`).
 - Optionally, it would create a venv that is used for building wheels (#30527). 
 - Using #29013, it could support several python versions
-- Make the build more incremental: On installation of `sage_conf`,  only run `configure` but do not install anything; rather, a Python entry point can be used by Python packages such as `sagemath-standard` to install packages if present.
+- #30036: Make the build more incremental: On installation of `sage_conf`,  only run `configure` but do not install anything; rather, a Python entry point can be used by Python packages such as `sagemath-standard` to install packages if present.
 
 

Changed commit from fa9485c to 7bdc524

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

7bdc524build/pkgs/sage_conf/src: Restore symlink

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

76d151ebuild/bin/write-dockerfile.sh: Fix up docker tests

Changed commit from 7bdc524 to 76d151e

Changed commit from 76d151e to 1a8cadc

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

1a8cadcsrc/pkgs/sage_conf-pypi/setup.cfg: Under version control, not gitignored

Changed commit from 1a8cadc to 31caddd

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

31cadddMerge tag '9.3.beta8' into t/29039/pip_installable_package_sage_bootstrap

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

f691585Merge tag '9.3.beta9' into t/30913/sagelib__add_setup_cfg__install_requires_
48d2a2bMerge branch 't/30913/sagelib__add_setup_cfg__install_requires_' into t/29039/pip_installable_package_sage_bootstrap

Changed commit from 31caddd to 48d2a2b

Changed dependencies from #30913, #31362, #31357, #31321 to #30913

Changed dependencies from #30913 to #30913, #30383

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

82d8030m4/sage_spkg_enable.m4: Cosmetic change to help strings
3e92998configure --disable-notebook: Fix up what packages are disabled
74a83fcbuild/pkgs/matplotlib/dependencies: Undo removal of tornado
93d31b9Remove use of unicode superscripts in configure --help
18fbb85m4/sage_spkg_collect.m4: Fix description of SAGE_OPTIONAL_CLEANED_PACKAGES
c3e4093Rename SAGE_OPTIONAL_CLEANED_PACKAGES to SAGE_OPTIONAL_UNINSTALLED_PACKAGES
4916415Merge tag '9.3.beta9' into t/30383/new_package_type__optional_enabled_by_default
a35428eMerge #30383
e098133src/pkgs/sage_conf/sage_conf.py.in: Add SAGE_SPKG_WHEELS
5dbd712src/pkgs/sage_conf-pypi/setup.py: Use 'configure --disable-notebook', run 'make build' so that wheels are built

Changed commit from 48d2a2b to 5dbd712

Changed commit from 5dbd712 to 100ff51

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

839c534src/pkgs/sage_conf-pypi/setup.py: Fix typo
100ff51src/pkgs/sage_conf-pypi/MANIFEST.in: Graft sage_root/build/pkgs/sage_docbuild/src

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

afa2ffdAdd configure option --disable-sagelib
a4f75b8src/pkgs/sage_conf-pypi: Use configure --disable-sagelib, update README

Changed commit from 100ff51 to a4f75b8

Changed commit from a4f75b8 to ac0f563

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

66c2987build/pkgs/{sage_sws2rst,sage_docbuild}/install-requires.txt: New
7f8ec6cbuild/pkgs/sagelib/src/tox.ini: Add factor sitepackages
0283da5build/make/Makefile.in: Add wheel, setuptools_wheel to PYTHON_TOOLCHAIN to make sure that PEP 517 packages have a complete build system
f720722build/pkgs/sagelib/src/tox.ini: Add factor nobuildisolation
c451b31src/setup.cfg.m4 (install_requires): Add sage_conf
6700223Merge tag '9.3.rc0' into t/30913/sagelib__add_setup_cfg__install_requires_
ac0f563Merge branch 't/30913/sagelib__add_setup_cfg__install_requires_' into t/29039/pip_installable_package_sage_bootstrap

Changed dependencies from #30913, #30383 to #30913

Description changed:

--- 
+++ 
@@ -30,6 +30,7 @@
 ```
 ./sage -sh -c build/pkgs/sage_conf/spkg-src
 ```
+(The source distribution has been uploaded to https://pypi.org/project/sage-conf/)
 
 Follow-up steps:
 - Make SAGE_ROOT configurable by the user (by passing `--prefix` to `setup.py`).

Description changed:

--- 
+++ 
@@ -1,4 +1,4 @@
-As #30913 makes `sage_conf` a PEP517/518 `build_system` `requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
+As #30913 makes `sage_conf` both (a) a PEP517/518 `build_system` `requires` and (b) an `install-requires` of sagelib (`sagemath-standard`), also a version of `sage_conf` must be made available on PyPI.
 
 This version of `sage_conf` includes a copy of `SAGE_ROOT` and `SAGE_ROOT/build/**` in its source distribution. On installation (or wheel building) it establishes a python-less SAGE_LOCAL hierarchy (#31362) in `~/.sage/` by running `configure` and `make build-local`; and then installs the configured `sage_conf.py` (#29038) as a Python module (and `sage-config`, `sage-env-config`). 
 
comment:57

what does the change to build/pkgs/sagelib/src/MANIFEST.in mean? is it becoming a symbolic link?

comment:58

after merging 9.3.rc2 in, I get an error (is it from sh: line 0: .: .homebrew-build-env: file not found, cf below ?):

$ ./bootstrap && (cd src/pkgs/sage_conf-pypi/ && tox -v -v -v)
...
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    writing manifest file '/home/scratch2/dimpase/tmp/pip-modern-metadata-27nf1gz1/sage_conf.egg-info/SOURCES.txt'
    creating '/home/scratch2/dimpase/tmp/pip-modern-metadata-27nf1gz1/sage_conf.dist-info'
    Preparing wheel metadata ... done
  Source in /home/scratch2/dimpase/tmp/pip-req-build-0rrkid61 has version 9.3rc2, which satisfies requirement sage-conf==9.3rc2 from file:///home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/.tmp/package/1/sage_conf-9.3rc2.zip
  Removed sage-conf==9.3rc2 from file:///home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/.tmp/package/1/sage_conf-9.3rc2.zip from build tracker '/home/scratch2/dimpase/tmp/pip-req-tracker-bla_u_md'
Created temporary directory: /home/scratch2/dimpase/tmp/pip-unpack-rwlm13mn
Building wheels for collected packages: sage-conf
  Created temporary directory: /home/scratch2/dimpase/tmp/pip-wheel-k4duer3n
  Destination directory: /home/scratch2/dimpase/tmp/pip-wheel-k4duer3n
  Running command /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /home/scratch2/dimpase/tmp/tmpdhib0roj
  running bdist_wheel
  running build
  running build_py
  sh: line 0: .: .homebrew-build-env: file not found
  Running cd /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.rc2-cpython-37m-x86_64-linux-gnu && . .homebrew-build-env 2>&1; : && ./configure --prefix=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.rc2-cpython-37m-x86_64-linux-gnu/local --with-python=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python --with-system-python3=force --disable-notebook --disable-sagelib
  error: configure failed
  Building wheel for sage-conf (PEP 517) ... error
  ERROR: Failed building wheel for sage-conf
Failed to build sage-conf
ERROR: Could not build wheels for sage-conf which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 361, in run
    ", ".join(pep517_build_failure_names)
pip._internal.exceptions.InstallationError: Could not build wheels for sage-conf which use PEP 517 and cannot be installed directly
Removed build tracker: '/home/scratch2/dimpase/tmp/pip-req-tracker-bla_u_md'
python finish: installpkg after 3.39 seconds
python start: envreport 
setting PATH=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin:/users/dimpase/perl5/bin:/users/dimpase/bin:/usr/libexec/python3-sphinx:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/users/dimpase/.cabal/bin:/auto/users/dimpase/bin
  /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi$ /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python -m pip freeze >/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/log/python-3.log
python finish: envreport after 0.20 seconds
python installed: 
_________________________________________________________________________________________________ summary __________________________________________________________________________________________________
ERROR:   python: InvocationError for command '/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python -m pip install --no-deps -U -v /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/.tmp/package/1/sage_conf-9.3rc2.zip' (exited with code 1)
cleanup /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/.tmp/package/1/sage_conf-9.3rc2.zip
comment:59

this is on Fedora 30, in case it matters

Reviewer: Dima Pasechnik

comment:60

Replying to @dimpase:

what does the change to build/pkgs/sagelib/src/MANIFEST.in mean? is it becoming a symbolic link?

Yes, it was duplicated with SAGE_ROOT/src/MANIFEST.in, and I replaced it with a symlink

Changed commit from ac0f563 to 1b03fa9

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

9a3aa38build/bin/write-dockerfile.sh: ADD some missing files in SAGE_ROOT
1b03fa9src/pkgs/sage_conf-pypi/setup.py: Change SETENV so that it works in shells with set -e
comment:62

Replying to @dimpase:

after merging 9.3.rc2 in, I get an error (is it from sh: line 0: .: .homebrew-build-env: file not found, cf below ?):

$ ./bootstrap && (cd src/pkgs/sage_conf-pypi/ && tox -v -v -v)
...

Thanks for testing! Is this running in a docker container? Not clear to me why the file would be missing. Anyway I have cherry-picked a related change from #31396 and made another change - please take a look if this gets farther

comment:64

no, still the same error:

...
Created temporary directory: /home/scratch2/dimpase/tmp/pip-unpack-169y8koj
Building wheels for collected packages: sage-conf
  Created temporary directory: /home/scratch2/dimpase/tmp/pip-wheel-exb6ynmx
  Destination directory: /home/scratch2/dimpase/tmp/pip-wheel-exb6ynmx
  Running command /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /home/scratch2/dimpase/tmp/tmpvehv3h0s
  running bdist_wheel
  running build
  running build_py
  sh: line 0: .: .homebrew-build-env: file not found
  Running cd /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.rc2-cpython-37m-x86_64-linux-gnu && (. .homebrew-build-env 2>&1 || :) && ./configure --prefix=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.rc2-cpython-37m-x86_64-linux-gnu/local --with-python=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python --with-system-python3=force --disable-notebook --disable-sagelib
  error: configure failed
  Building wheel for sage-conf (PEP 517) ... error
  ERROR: Failed building wheel for sage-conf
Failed to build sage-conf
ERROR: Could not build wheels for sage-conf which use PEP 517 and cannot be installed directly
Exception information:
Traceback (most recent call last):
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 361, in run
    ", ".join(pep517_build_failure_names)
pip._internal.exceptions.InstallationError: Could not build wheels for sage-conf which use PEP 517 and cannot be installed directly
Removed build tracker: '/home/scratch2/dimpase/tmp/pip-req-tracker-_6q2pk49'
python finish: installpkg after 3.35 seconds
python start: envreport 
setting PATH=/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin:/users/dimpase/perl5/bin:/users/dimpase/bin:/usr/libexec/python3-sphinx:/usr/lib64/qt-3.3/bin:/usr/share/Modules/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/users/dimpase/.cabal/bin:/auto/users/dimpase/bin
  /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi$ /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python -m pip freeze >/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/log/python-9.log
python finish: envreport after 0.20 seconds
python installed: 
__________________________________________________________________________ summary ___________________________________________________________________________
ERROR:   python: InvocationError for command '/home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/bin/python -m pip install --no-deps -U -v /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/.tmp/package/1/sage_conf-9.3rc2.zip' (exited with code 1)
comment:66

Could you show what's in /home/scratch2/dimpase/sage/sage/src/pkgs/sage_conf-pypi/.tox/python/.sage/sage-9.3.rc2-cpython-37m-x86_64-linux-gnu?