This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'u/mkoeppe/src_bin_sage_env__make_sure__sage_venv_bin_is…
…_at_the_beginning_of_the_path' of git://trac.sagemath.org/sage into t/30578/add-src-requirements-txt
- Loading branch information
Showing
8 changed files
with
94 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# -*- shell-script -*- @configure_input@ | ||
|
||
########################################################################### | ||
# | ||
# Set some environment variables that are needed at the runtime of Sage | ||
# and by its child processes. | ||
# | ||
# This file is only for use when sage is invoked from SAGE_ROOT. | ||
# It is not installed in SAGE_LOCAL. | ||
# | ||
# NOTES: | ||
# - You must *source* this script instead of executing. | ||
# - Use "return" instead of "exit" to signal a failure. Since this | ||
# file is sourced, an "exit" here will actually exit src/bin/sage, | ||
# which is probably not intended. | ||
# - Environment variables that should be available in the Sage environment | ||
# should be exported. | ||
# - This file is only for setting immediate values. Any kind of conditionals | ||
# or computed values are to be set by src/bin/sage-env after sourcing this | ||
# file. | ||
# - Environment variables that are only needed at the time of building | ||
# SPKGs or sagelib should be set in build/bin/sage-build-env-config | ||
# instead. | ||
# - Configuration variables that are only needed by the Sage runtime, | ||
# but not as environment variables, should instead be set in | ||
# build/pkgs/sage_conf/src/sage_conf.py | ||
# | ||
########################################################################## | ||
|
||
# SAGE_LOCAL is the installation prefix and can be customized by using | ||
# ./configure --prefix | ||
export SAGE_LOCAL="@prefix@" | ||
|
||
# SAGE_VENV is the root of the virtual environment of sagelib. | ||
# Currently, it is identical to SAGE_LOCAL | ||
export SAGE_VENV="@prefix@" | ||
|
||
# SAGE_ROOT is the location of the Sage source/build tree. | ||
export SAGE_ROOT="@SAGE_ROOT@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /doesnotexist/python3 | ||
# this interpreter will be replaced by the interpreter in the venv | ||
# during installation. | ||
|
||
try: | ||
from sage_conf import * | ||
except ImportError: | ||
pass | ||
|
||
from sys import prefix as SAGE_VENV | ||
|
||
def _main(): | ||
from argparse import ArgumentParser | ||
from sys import exit, stdout | ||
parser = ArgumentParser() | ||
parser.add_argument('--version', help="show version", action="version", | ||
version='%(prog)s ' + VERSION) | ||
parser.add_argument("VARIABLE", nargs='?', help="output the value of VARIABLE") | ||
args = parser.parse_args() | ||
d = globals() | ||
if args.VARIABLE: | ||
stdout.write('{}\n'.format(d[args.VARIABLE])) | ||
else: | ||
for k, v in d.items(): | ||
if not k.startswith('_'): | ||
stdout.write('{}={}\n'.format(k, v)) | ||
|
||
if __name__ == "__main__": | ||
_main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters