I made a simple script that maps the dependency graph using the conda API.
I would like to use this to parallelize our release procedure.
Check the code bellow.
#### Create a simple dependency graph using "conda search"import conda.cli.python_apiimport jsonimport numpypackages_to_release = [ "bob.buildout", "bob.extension", "bob.blitz", "bob.core", "bob.io.base", "bob.math","bob.measure", "bob.io.image","bob.db.base","bob.io.video", "bob.io.matlab","bob.io.audio", "bob.sp","bob.ap","bob.ip.base", "bob.ip.color","bob.ip.draw", "bob.ip.gabor","bob.learn.activation"]def get_dependencies(package_description, selected_packages=[]): """ Given a dictionary containing the package description "conda search xx --info" get a selected set of dependencies """ # Fetching the dependencies of the most updated package all_dependencies = [p.split(" ")[0] for p in package_description[-1]["depends"]] # Filtering the dependencies return [d for d in selected_packages if d in all_dependencies]#TODO: We can use some python libraries to handle graphs, but I# have more fun doing like thisN = len(packages_to_release)adjacency_matrix = numpy.zeros(shape=(N, N))### Building the graphfor i,p in enumerate(packages_to_release): package_description = json.loads(conda.cli.python_api.run_command(conda.cli.python_api.Commands.SEARCH, p, "--info", "-c", "http://idiap.ch/software/bob/conda/label/beta/", "--json")[0]) # Getting the "releasable" dependencies dependencies = get_dependencies(package_description[p], selected_packages=packages_to_release) # Handling the adjacency matrix indexes = [packages_to_release.index(d) for d in dependencies] for j in indexes: adjacency_matrix[i,j] = 1print(adjacency_matrix)