Skip to content

Commit

Permalink
exclude test folders from directory walk
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranvasudev committed Nov 8, 2024
1 parent 450b544 commit f207b2b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dagger/utilities/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,11 @@ def load_plugins_to_jinja_environment(environment: jinja2.Environment) -> jinja2
Returns:
dict: A dictionary with the class name as key and the class object as value
"""
classes = {}

for plugin_path in conf.PLUGIN_DIRS:
for root, dirs, files in os.walk(plugin_path):
dirs[:] = [directory for directory in dirs if not directory.lower().startswith("test")]
for plugin_file in files:
if plugin_file.endswith(".py") and not plugin_file.startswith("__"):
if plugin_file.endswith(".py") and not (plugin_file.startswith("__") or plugin_file.startswith("testΩ"):):
module_name = plugin_file.replace(".py", "")
module_path = os.path.join(root, plugin_file)
spec = importlib.util.spec_from_file_location(module_name, module_path)
Expand Down

0 comments on commit f207b2b

Please sign in to comment.