Skip to content
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

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

Closed
mkoeppe opened this issue Jan 18, 2020 · 227 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Jan 18, 2020

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.
  • sage-conf_pypi: API for incremental builds #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

@mkoeppe mkoeppe added this to the sage-9.1 milestone Jan 18, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe removed this from the sage-9.1 milestone Jan 30, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe added this to the sage-9.3 milestone Jun 28, 2020
@mkoeppe mkoeppe changed the title Package sage_local pip-installable package sage_bootstrap Jun 28, 2020
@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 29, 2020

Dependencies: #30025

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 29, 2020

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 29, 2020

New commits:

6e28ae5Add sage_root to sage_bootstrap

@mkoeppe
Copy link
Member Author

mkoeppe commented Jun 29, 2020

Commit: 6e28ae5

@mkoeppe

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 30, 2020

Changed commit from 6e28ae5 to a6373b7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 30, 2020

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

a6373b7build/setup.py: Add sage_root as package_data

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 1, 2020

Changed commit from a6373b7 to b0ddab0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 1, 2020

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

441cb6eWorking sdist and install
b0ddab0Simplify directory structure

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 1, 2020

Changed dependencies from #30025 to #30025, #29850

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 1, 2020

Changed commit from b0ddab0 to 60642d3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 1, 2020

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

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 1, 2020

Changed dependencies from #30025, #29850 to #30025

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 3, 2020

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

8006b6fAdd sage_bootstrap.build

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 3, 2020

Changed commit from 60642d3 to 8006b6f

@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 3, 2020

Work Issues: sage-system-python in installed sage_bootstrap

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 19, 2021

Changed commit from 0026892 to 2a4a323

@jhpalmieri
Copy link
Member

comment:160

Replying to @mkoeppe:

Note that make distclean does not clean stuff in .tox, so if you want to start from scratch, use tox -r

Should make distclean clean stuff in .tox? Running tox -r might have helped with a problem at https://ask.sagemath.org/question/60029/sage-not-installing-from-source.

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 3, 2021

comment:161

It shouldn't (because .tox is not an artifact of the normal build that is orchestrated by "make"), and this user's problems have nothing to do with tox

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 19, 2021

comment:162

Release script seems to have skipped this ticket

@vbraun
Copy link
Member

vbraun commented Dec 28, 2021

Changed dependencies from #32442 to none

@vbraun
Copy link
Member

vbraun commented Dec 28, 2021

comment:163

This ticket depends on a ticket that has no attached branch, hence it'll never be merged

@mkoeppe
Copy link
Member Author

mkoeppe commented Dec 28, 2021

comment:164

Thanks

@vbraun
Copy link
Member

vbraun commented Dec 29, 2021

Changed branch from u/mkoeppe/pip_installable_package_sage_bootstrap to 2a4a323

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 1, 2022

Changed commit from 2a4a323 to none

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 1, 2022

comment:166

Replying to @kiwifb:

A little bit late at this stage to ask for stuff but here it goes. Would it be appropriate to split the file sage_conf.py into two parts?

One that would keep the name and contains the main function and doesn't need to be configured, and the second one that just contains the variables and that would be pre-parsed by configure.

The idea being that distro could just provide/configure the second file has they see fit without touching the functionality of the package.

Done now in #31396. Happy new year!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants