Skip to content

Commit

Permalink
Trac #29850: Install sage-env-config as part of sage_conf
Browse files Browse the repository at this point in the history
As a follow-up to #21559 and #30128, we reassign `sage-env-config` from
the package `sagelib` to the package `sage_conf`.

(After #22731, `sage-env-config` is no longer required by the `sage`
script.)

(This is preparation for allowing installation of sagelib for example in
a conda environment without having to run ./configure first - see
#28745, #30845.)

------

Part of Meta-ticket #21707: Split sage-env into 5 to clean up sage
configuration

URL: https://trac.sagemath.org/29850
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 13, 2020
2 parents 5f46b34 + 4b52dcf commit c06aabc
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build/pkgs/sage_conf/dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$(PYTHON) ../pkgs/sage_conf/src/sage_conf.py ../pkgs/sage_conf/src/setup.cfg | $(PYTHON_TOOLCHAIN)
$(PYTHON) ../pkgs/sage_conf/src/sage_conf.py ../pkgs/sage_conf/src/setup.cfg ../pkgs/sage_conf/src/bin/sage-env-config | $(PYTHON_TOOLCHAIN)
6 changes: 5 additions & 1 deletion build/pkgs/sage_conf/spkg-install
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ if [ $? -ne 0 ]; then
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?"
exit 1
fi
cd src && sdh_pip_install .
cd src
# Need to build a wheel manually because pip does not
# follow symlinks.
sdh_setup_bdist_wheel
sdh_store_and_pip_install_wheel .
21 changes: 21 additions & 0 deletions build/pkgs/sage_conf/spkg-src
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Script to prepare an sdist tarball for sage_conf
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# ./sage --sh build/pkgs/sage_conf/spkg-src

if [ -z "$SAGE_ROOT" ] ; then
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
echo >&2 "Maybe run 'sage -sh'?"
exit 1
fi

# Exit on failure
set -e

cd build/pkgs/sage_conf

cd src
sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
1 change: 1 addition & 0 deletions build/pkgs/sage_conf/src/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include bin/sage-env-config
1 change: 1 addition & 0 deletions build/pkgs/sage_conf/src/bin/sage-env-config
3 changes: 3 additions & 0 deletions build/pkgs/sage_conf/src/setup.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ url = https://www.sagemath.org
py_modules =
sage_conf

scripts =
bin/sage-env-config

[options.entry_points]
console_scripts =
sage-config = sage_conf:_main
2 changes: 1 addition & 1 deletion build/pkgs/sagelib/src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
## Uncategorized scripts in alphabetical order
'bin/math-readline',
'bin/sage-env',
'bin/sage-env-config',
# sage-env-config -- installed by sage_conf
# sage-env-config.in -- not to be installed',
'bin/sage-gdb-commands',
'bin/sage-grep',
Expand Down
4 changes: 2 additions & 2 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
## Uncategorized scripts in alphabetical order
'bin/math-readline',
'bin/sage-env',
'bin/sage-env-config',
# sage-env-config.in -- not to be installed',
# sage-env-config -- installed by sage_conf
# sage-env-config.in -- not to be installed
'bin/sage-gdb-commands',
'bin/sage-grep',
'bin/sage-grepdoc',
Expand Down

0 comments on commit c06aabc

Please sign in to comment.