From d1ef2c8cbf5e269bc9e2871d34dcae59f4b94b14 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 3 Feb 2021 12:41:30 -0300 Subject: [PATCH] Added style dependency in pcbdraw makefile target. - Also now we make sure the style is an existent file. --- kibot/out_pcbdraw.py | 2 +- tests/test_plot/test_misc.py | 5 ++++- tests/yaml_samples/makefile_1.kibot.yaml | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kibot/out_pcbdraw.py b/kibot/out_pcbdraw.py index ebb4db6e..1b439c8b 100644 --- a/kibot/out_pcbdraw.py +++ b/kibot/out_pcbdraw.py @@ -306,6 +306,6 @@ class PcbDraw(BaseOutput): # noqa: F821 def get_dependencies(self): files = super().get_dependencies() - if isinstance(self.options.style, str): + if isinstance(self.options.style, str) and os.path.isfile(self.options.style): files.append(self.options.style) return files diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 94ff22ae..12e1f24d 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -602,7 +602,10 @@ def test_makefile_1(test_dir): deps = targets['pcb_render'].split(' ') assert len(deps) == 1, deps assert ctx.get_out_path(prj+'-top$.svg') in deps - assert os.path.abspath(targets[targets['pcb_render']]) == ctx.board_file + deps = targets[targets['pcb_render']].split(' ') + assert len(deps) == 2 + assert os.path.relpath(ctx.board_file) in deps + assert 'tests/data/html_style.css' in deps logging.debug('- Target `pcb_render` OK') # print_front target deps = targets['print_front'].split(' ') diff --git a/tests/yaml_samples/makefile_1.kibot.yaml b/tests/yaml_samples/makefile_1.kibot.yaml index 2ecd7f2a..3d8edcf2 100644 --- a/tests/yaml_samples/makefile_1.kibot.yaml +++ b/tests/yaml_samples/makefile_1.kibot.yaml @@ -69,6 +69,7 @@ outputs: type: pcbdraw options: output: '%f-%i$.%x' + style: 'tests/data/html_style.css' - name: 'print_front' comment: "Print F.Cu+F.SilkS"