File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 2
2
r"""
3
3
Sage Runtime Environment
4
4
5
- Verify that importing ``sage.all`` works in Sage's Python without any
6
- ``SAGE_`` environment variables, and has the same ``SAGE_ROOT`` and
7
- ``SAGE_LOCAL`` (see also :issue:`29446`). If ``SAGE_ROOT`` is a path,
8
- we normalize it, but keep in mind that ``SAGE_ROOT`` may also be
9
- ``None``::
10
-
11
- sage: env = {k:v for (k,v) in os.environ.items() if not k.startswith("SAGE_")}
12
- sage: from subprocess import check_output
13
- sage: module_name = "sage.all" # hide .all import from the linter
14
- sage: cmd = f"from {module_name} import SAGE_ROOT, SAGE_LOCAL;"
15
- sage: cmd += "from os.path import samefile;"
16
- sage: if SAGE_ROOT is None:
17
- ....: cmd += "s1 = SAGE_ROOT is None;"
18
- ....: else:
19
- ....: cmd += f"s1 = samefile(SAGE_ROOT, '{SAGE_ROOT}');"
20
- sage: cmd += f"s2 = samefile(SAGE_LOCAL, '{SAGE_LOCAL}');"
21
- sage: cmd += "print(s1 and s2);"
22
- sage: out = check_output([sys.executable, "-c", cmd], env=env).decode().strip() # long time
23
- sage: out == "True" # long time
24
- True
25
-
26
5
AUTHORS:
27
6
28
7
- \R. Andrew Ohana (2012): initial version
You can’t perform that action at this time.
0 commit comments