[sage-devel] Re: Question on the features introduced by #20382

2018-09-12 Thread Simon King
Hi Jeroen,

On 2018-09-12, Jeroen Demeyer  wrote:
> Why does a Python file care whether the normaliz library and headers are 
> installed? Now I'm looking at #25091 and it seems to me (but correct me 
> if I'm wrong) that you *really* care about the PyNormaliz Python module, 
> for which there is a different feature test.

That's quite possibly true.

> The whole idea of the new features framework is to make the feature test 
> as close as possible to the actual usage of the feature.

... which I find very reasonable!

If it is PyNormaliz then I guess there is some import statement that
would fail if it wasn't installed, right?

Best regards,
Simon

-- 
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.


Re: [sage-devel] Re: Question on the features introduced by #20382

2018-09-11 Thread Jeroen Demeyer

On 2018-09-12 07:42, Simon King wrote:

However, the place in #25090/#25091 where the author uses is_package_installed,
is a Python file.


Why does a Python file care whether the normaliz library and headers are 
installed? Now I'm looking at #25091 and it seems to me (but correct me 
if I'm wrong) that you *really* care about the PyNormaliz Python module, 
for which there is a different feature test.


The whole idea of the new features framework is to make the feature test 
as close as possible to the actual usage of the feature. We don't check 
for the presence of a Sage package, we check whatever feature that you 
need from that Sage package. For example, if it's a Python module, we 
try to import it.


Another way of seeing this: ask the question what would go wrong if the 
package wasn't installed but we skipped the feature check? That thing 
where it goes wrong is what you need to test for.


--
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.


[sage-devel] Re: Question on the features introduced by #20382

2018-09-11 Thread Simon King
Hi Jeroen,

On 2018-09-11, Jeroen Demeyer  wrote:
> On 2018-09-11 18:55, Simon King wrote:
>> Specifically, I ask because of #25090/#25091: How can one test whether
>> normaliz is installed?
>
> Use Cython: see src/sage/features/bliss.py for an example for the 
> "bliss" library

Thank you. If it was in Cython, I would have suggested to use OptionalExtension.
However, the place in #25090/#25091 where the author uses is_package_installed,
is a Python file.

Best regards,
Simon

-- 
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.