diff --git a/anta/py.typed b/anta/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/anta/tests/connectivity.py b/anta/tests/connectivity.py index b26c770fd..afcfa118e 100644 --- a/anta/tests/connectivity.py +++ b/anta/tests/connectivity.py @@ -56,13 +56,12 @@ class Input(AntaTest.Input): def render(self, template: AntaTemplate) -> list[AntaCommand]: """Render the template for each host in the input list.""" - commands = [] - for host in self.inputs.hosts: - # df_bit includes leading space when enabled, empty string when disabled - df_bit = " df-bit" if host.df_bit else "" - command = template.render(destination=host.destination, source=host.source, vrf=host.vrf, repeat=host.repeat, size=host.size, df_bit=df_bit) - commands.append(command) - return commands + return [ + template.render( + destination=host.destination, source=host.source, vrf=host.vrf, repeat=host.repeat, size=host.size, df_bit=" df-bit" if host.df_bit else "" + ) + for host in self.inputs.hosts + ] @AntaTest.anta_test def test(self) -> None: diff --git a/pyproject.toml b/pyproject.toml index d6f2bd47a..ff2357865 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,13 +109,13 @@ Contributing = "https://anta.arista.com/main/contribution/" [project.scripts] anta = "anta.cli:cli" -################################ -# Tools -################################ [tool.setuptools.packages.find] include = ["anta*", "asynceapi*"] namespaces = false +[tool.setuptools.package-data] +"anta" = ["py.typed"] + ################################ # Version ################################