[sage-devel] Re: spkgs dependencies graph

2019-01-30 Thread Volker Braun
If you want to use it for external dependencies you'll probably need to 
know about acceptable versions of these. Then you'll soon need a sat 
solver; E.g. conda does in that way.

On Tuesday, January 29, 2019 at 7:45:07 PM UTC+1, Dima Pasechnik wrote:
>
> Has anyone written code to compute it? 
> (and create a Sage graph out of it, maybe) 
>

-- 
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: spkgs dependencies graph

2019-01-29 Thread John H Palmieri
Cool, and then you can call Poset(digraph_spkg()).



On Tuesday, January 29, 2019 at 12:56:07 PM UTC-8, Frédéric Chapoton wrote:
>
> Quick tentative, not smooth:
>
> from sage.misc.package import *
>
>
>
>
> def digraph_spkg():
> """
> digraph
> """
> opts = {}
>
>
> local = opts.pop('local', False)
> ignore_URLError = opts.pop('ignore_URLError', False)
> exclude_pip = opts.pop('exclude_pip', False)
> if opts:
> raise ValueError("{} are not valid options".format(sorted(opts)))
>
>
> installed = installed_packages(exclude_pip)
>
>
> pkgs = {}
>
>
> for p in os.listdir(SAGE_PKGS):
> try:
> f = open(os.path.join(SAGE_PKGS, p, "dependencies"))
> except IOError:
> # Probably an empty directory => ignore
> continue
>
>
> with f:
> deps = f.read().splitlines()[0].strip()
>
>
> if 'no dependencies' in deps:
> continue
> if 'not a real package' in deps:
> continue
> 
> pkgs[p] = [u for u in deps.split() if u != "|" ]
>
>
> return DiGraph(pkgs)
>
>
>
>
> Le mardi 29 janvier 2019 19:45:07 UTC+1, Dima Pasechnik a écrit :
>>
>> Has anyone written code to compute it? 
>> (and create a Sage graph out of it, maybe) 
>>
>

-- 
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: spkgs dependencies graph

2019-01-29 Thread Frédéric Chapoton
Quick tentative, not smooth:

from sage.misc.package import *




def digraph_spkg():
"""
digraph
"""
opts = {}


local = opts.pop('local', False)
ignore_URLError = opts.pop('ignore_URLError', False)
exclude_pip = opts.pop('exclude_pip', False)
if opts:
raise ValueError("{} are not valid options".format(sorted(opts)))


installed = installed_packages(exclude_pip)


pkgs = {}


for p in os.listdir(SAGE_PKGS):
try:
f = open(os.path.join(SAGE_PKGS, p, "dependencies"))
except IOError:
# Probably an empty directory => ignore
continue


with f:
deps = f.read().splitlines()[0].strip()


if 'no dependencies' in deps:
continue
if 'not a real package' in deps:
continue

pkgs[p] = [u for u in deps.split() if u != "|" ]


return DiGraph(pkgs)




Le mardi 29 janvier 2019 19:45:07 UTC+1, Dima Pasechnik a écrit :
>
> Has anyone written code to compute it? 
> (and create a Sage graph out of it, maybe) 
>

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