-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Problems when running without SAGE_VENV #33625
Comments
comment:1
For problem 2 ( If the line I'm not sure that's really useful but it's harmless if unused. |
comment:2
For the other issues, maybe it would be wise to introduce I think, similar to my fix for #33624, that using I think the CC: mkoeppe for RFC |
comment:3
Note |
Replying to @tornaria:
We may want to determine the correct path using https://docs.python.org/3/library/importlib.metadata.html#module-importlib.metadata |
Replying to @tornaria:
It only uses it (as part of a search path) when also |
comment:6
Replying to @mkoeppe:
Relevant: https://discuss.python.org/t/proper-way-to-determine-install-location-of-console-scripts/7188 |
comment:7
This works:
|
comment:8
Replying to @mkoeppe:
Hmmm... not really. It seems to be a list of source files:
This is in my system install of sagemath, which was installed using I assume importlib.metadata obtains the info from One easy way to obtain the path to the scripts directory would be as However, there doesn't seem to be any way to make this work when using sage as a python module. Unless this is saved somewhere in the sage package or in the sagemath_standard egg-info at install time. |
comment:9
Replying to @tornaria:
Similar to what I said in #33624 comment:5, I think it's best to give up on using the legacy setuptools command options such as |
comment:10
I do agree though that using |
This comment has been minimized.
This comment has been minimized.
comment:12
Replying to @mkoeppe:
TIL that, since there's no indication anywhere that
What about The main reason I'm using Maybe these non-user scripts can be placed in a different location. I don't know if there's a standard location for this purpose. Other packages that install "hidden" binaries, e.g. git installs a bunch of binaries in Would it be outrageous to place them at |
comment:13
Replying to @tornaria:
All of |
comment:14
Replying to @tornaria:
No, this is not passed on to any of the packages that sage-the-distribution installs. The option is there because of the (unused) |
comment:15
Replying to @tornaria:
Yes, at least some of these have a "libexec" flavor.
I'm not aware of one in Python packaging.
See #33627 for a step in this direction |
@mkoeppe help here. The fault is caused by this code in
which was added by 1a518c0 in #30013. I assume removing this will regress on #30013 and I don't understand what is going on there. IMHO, nothing in sagelib should be touching the |
Thanks for the reminder. I agree this needs to be fixed. I'll take a look in the next days. |
Example context:
sys.prefix = /usr
(used for system python packages)Say
$SAGE_LIB
contains the sage python library and$SAGE_BIN
contains the scripts. I can run this sagelib by settingwhich will pick this sagelib (overriding a system sagelib if installed, both in scripts and python packages).
However, there are a few issues with this, since:
a.
sage-env
usessage-venv-config
toSAGE_VENV
tosys.prefix
b. there are a few places where it is assumed that the sage scripts live in
SAGE_VENV/bin
, thus breaking stuff.c. in particular
sage-env
itself prependsSAGE_VENV/bin
toPATH
.Problem 1: If I don't have any system sage installed in
/usr/bin/sage
. This causes a doctest failure (#33624, very easy fix).Problem 2: If I have a system sage installed in
/usr/bin/sage
but it is a different version than the one I'm trying to run. This causes trouble because aftersage-env
prepends PATH withSAGE_VENV/bin
thesage
script inSAGE_BIN
will be overrided (for example, doctestingsrc/sage/doctest/test.py
causes trouble).Other problems? Maybe (untested)
a. #33627 -
sage.doctest.control
usesSAGE_VENV/bin/sage-gdb-commands
so it won't workb.
sage.features
looks for binaries inSAGE_VENV/bin
c.
sage.repl.ipython_kernel.install
usesSAGE_VENV/bin/sage
when configuring jupyter kernel so it seems it will end up running the system sage.CC: @mkoeppe
Component: scripts
Issue created by migration from https://trac.sagemath.org/ticket/33625
The text was updated successfully, but these errors were encountered: