On Thursday, May 17, 2018 at 1:01:21 AM UTC-7, François Bissey wrote:
>
> Actually in sage-on-gentoo I reduced that quite a bit. In vanilla we have 
> "argv": ["/home/fbissey/sandbox/git-fork/sage-8.3.b0/local/bin/sage", 
> "--python", "-m", "sage.repl.ipython_kernel", "-f", "{connection_file}”] 
> That is, sage-devs go to quite some lengths to launch sage’s python with 
> the sage 
> ipython_kernel module. 
>
> In sage-on-gentoo I just do this at the moment: 
> {"argv": ["python2.7", "-m", "sage.repl.ipython_kernel", "-f", 
> "{connection_file}”] 
>

Yes, I wasn't going *that* far. I'm still assuming a normal 
sage-the-distribution install. I'm just trying to make the kernelspec 
available to the jupyter in the global python.

I am a little surprised by the executable name chosen as well: if the 
kernel-spec generated is supposed to run in an environment already set up 
for sage, then "python" should be the sage-aware python, and then "python" 
would just do the trick. Or, with an absolute path, 
"$SAGE_LOCAL/bin/python". I'm happy that it's not, though, because the 
error generated by "$SAGE_LOCAL/bin/sage" about the absence of SAGE_ROOT is 
a lot more informative.


> On 17/05/2018, at 18:56, Antonio Rojas <nqn...@gmail.com <javascript:>> 
> wrote: 
> > 
> > El jueves, 17 de mayo de 2018, 6:46:11 (UTC+2), Nils Bruin escribió: 
> > 
> > Are there good reasons to refer to .../local/bin/sage rather than the 
> .../sage script? If not, then it might be more flexible to change it. 
> > 
> > 
> > This would break distribution packages, where SAGE_LOCAL is generally 
> set to /usr and SAGE_ROOT/sage doesn't exist. In general, references to 
> SAGE_ROOT within the sage python library should be avoided as they cause 
> issues when packaging.


I see. We assemble the line here:

 
https://github.com/sagemath/sage/blob/854f9764d14236110b8d7f7b35a7d52017e044f8/src/sage/repl/ipython_kernel/install.py#L150

What would be the right way of distinguishing between whether we're in a 
"distribution package", where there is no SAGE_ROOT/sage, or the "standard" 
situation, where all sage stuff is in the same place and SAGE_ROOT/sage is 
present and has the logic to work out what SAGE_ROOT should be set to? If 
we know how to distinguish between the two, is would be very easy to put 
some logic in the script to produce appropriate code in either situation.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to