3434
3535logging .getLogger ().setLevel (logging .INFO )
3636
37- def path_excluded (path ):
38- return "-nspkg" in path or "tests" in path or "mgmt " in path or is_metapackage (path )
37+ def path_excluded (path , additional_excludes ):
38+ return any ([ excl in path for excl in additional_excludes ]) or "tests " in path or is_metapackage (path )
3939
4040# Metapackages do not have an 'azure' folder within them
4141def is_metapackage (package_path ):
@@ -44,13 +44,13 @@ def is_metapackage(package_path):
4444 azure_path = path .join (dir_path , 'azure' )
4545 return not path .exists (azure_path )
4646
47- def get_setup_py_paths (glob_string , base_path ):
47+ def get_setup_py_paths (glob_string , base_path , additional_excludes ):
4848 setup_paths = process_glob_string (glob_string , base_path )
49- filtered_paths = [path .join (p , 'setup.py' ) for p in setup_paths if not path_excluded (p )]
49+ filtered_paths = [path .join (p , 'setup.py' ) for p in setup_paths if not path_excluded (p , additional_excludes )]
5050 return filtered_paths
5151
5252
53- def get_packages (args , package_name = "" ):
53+ def get_packages (args , package_name = "" , additional_excludes = [] ):
5454 # This function returns list of path to setup.py and setup info like install requires, version for all packages discovered using glob
5555 # Followiong are the list of arguements expected and parsed by this method
5656 # service, glob_string
@@ -59,7 +59,7 @@ def get_packages(args, package_name = ""):
5959 else :
6060 target_dir = root_dir
6161
62- paths = get_setup_py_paths (args .glob_string , target_dir )
62+ paths = get_setup_py_paths (args .glob_string , target_dir , additional_excludes )
6363
6464 # Check if package is excluded if a package name param is passed
6565 if package_name and not any (filter (lambda x : package_name == os .path .basename (os .path .dirname (x )), paths )):
0 commit comments