/dep_graph

This program reads a JSON file containing a list of packages and their dependencies. And returns the Full Dependency Graph.

Primary LanguagePython

dep_graph

This program reada a JSON file from a fixed filesystem location, e.g. /tmp/deps.json, containing a list of packages and their dependencies. In this JSON file, a key represents a package name, and the value is a list of dependencies (package names) for that key:

{
  "pkg1": ["pkg2", "pkg3"],
  "pkg2": ["pkg3"],
  "pkg3": []
}

The the goal is to traverse the whole graph for every dependency. The result is a list containing all the visited dependencies.

  Full Dependency Graph.
  
  ['pkg1', 'pkg2', 'pkg3', 'pkg3', 'pkg2', 'pkg3', 'pkg3']

Getting Started

Clone the repository.

git clone https://github.com/AggelosMargkas/dep_graph.git

Install requirements

Install the requirement.

pip install -r requirement.txt

Run dep_graph.

To run dep_graph you need to run the command below.

Run dep_graph.

python -m dep_graph

Run dep_graph.

To test it run.

pytest test_dep_graph.py