Skip to content

Commit

Permalink
Fix incorrect caching
Browse files Browse the repository at this point in the history
  • Loading branch information
17451k committed Apr 10, 2020
1 parent 629e78a commit 2da1216
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions clade/extensions/cmd_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def __init__(self, work_dir, conf=None):
self.graph_file = "cmd_graph.json"
self.graph_folder = "cmd_graph"

self.out_dict = dict()

self.graph_dot = os.path.join(self.work_dir, "cmd_graph.dot")
self.graph_with_files_dot = os.path.join(self.work_dir, "cmd_graph_with_files.dot")

Expand Down Expand Up @@ -121,17 +123,17 @@ def parse(self, cmds_file):

self.graph.clear()

def __add_to_graph(self, cmd, out_dict=dict()):
def __add_to_graph(self, cmd):
out_id = str(cmd["id"])
if out_id not in self.graph:
self.graph[out_id] = self.__get_new_value(cmd["type"])

for cmd_in in (
i
for i in self.extensions["Path"].get_rel_paths(cmd["in"], cmd["cwd"])
if i in out_dict
if i in self.out_dict
):
in_id = out_dict[cmd_in]
in_id = self.out_dict[cmd_in]

if out_id not in self.graph[in_id]["used_by"]:
self.graph[in_id]["used_by"].append(out_id)
Expand All @@ -140,7 +142,7 @@ def __add_to_graph(self, cmd, out_dict=dict()):

# Rewrite out_dict[cmd_out] values to keep the latest used command id
for cmd_out in self.extensions["Path"].get_rel_paths(cmd["out"], cmd["cwd"]):
out_dict[cmd_out] = out_id
self.out_dict[cmd_out] = out_id

def __print_cmd_graph(self):
dot = Digraph(graph_attr={'rankdir': 'LR'}, node_attr={'shape': 'rectangle'})
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def finalize_options(self):

setuptools.setup(
name="clade",
version="3.2.6",
version="3.2.7",
author="Ilya Shchepetkov",
author_email="shchepetkov@ispras.ru",
url="https://github.com/17451k/clade",
Expand Down

0 comments on commit 2da1216

Please sign in to comment.