Unverified Commit 29bc9dbc authored by Moisés López - https://www.vauxoo.com/'s avatar Moisés López - https://www.vauxoo.com/ 🖥
Browse files

[REF] reqgen: Search requirements files based on parameter

In order to be able to looking for requirements-test.txt where it is needed
parent 7183165a
Pipeline #181467 passed with stage
in 45 seconds
......@@ -136,7 +136,7 @@ def save_requirements(requirementstxt, filename, exclude_path=False):
req_file.write(req.line + '\n')
def search_reqs_files(folder_name, recursive=False):
def search_reqs_files(folder_name, recursive=False, requirements_name='requirements.txt'):
"""
Searchs for all requirements.txt file recursively in the given path
:param folder_name: the folder where you want to search
......@@ -144,7 +144,7 @@ def search_reqs_files(folder_name, recursive=False):
"""
res = list()
for base, directories, files in os.walk(folder_name):
for file_name in fnmatch.filter(files, 'requirements.txt'):
for file_name in fnmatch.filter(files, requirements_name):
res.append(os.path.join(base, file_name))
if not recursive:
# Clean the directories so the walk doesn't go any further
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment