Skip to content

Commit 2e6a259

Browse files
authored
Enhance notebook processing with logging
1 parent b61122f commit 2e6a259

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/convert_notebooks.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@
1515
def process_notebooks(directory="."):
1616
"""Find and process all notebook files in the repository"""
1717
notebook_files = []
18+
print(f"Searching for notebooks in directory: {directory}")
1819
for root, dirs, files in os.walk(directory):
20+
# Skip directories that should be excluded
1921
if '.git' in dirs:
2022
dirs.remove('.git') # Skip git directory
2123
if '.github' in dirs:
2224
dirs.remove('.github') # Skip GitHub directory
25+
if '.venv' in dirs:
26+
dirs.remove('.venv') # Skip virtual environments
27+
2328
for file in files:
2429
if file.endswith('.ipynb'):
25-
notebook_files.append(os.path.join(root, file))
30+
notebook_path = os.path.join(root, file)
31+
print(f"Found notebook: {notebook_path}")
32+
notebook_files.append(notebook_path)
2633

2734
print(f"Found {len(notebook_files)} notebooks to process")
2835

@@ -148,4 +155,7 @@ def convert_notebook(filepath):
148155

149156
if __name__ == "__main__":
150157
print("Rendering notebooks for GitHub compatibility...")
151-
process_notebooks()
158+
# Get the repository root directory from environment variable if available
159+
repo_root = os.environ.get('GITHUB_WORKSPACE', '.')
160+
print(f"Repository root: {repo_root}")
161+
process_notebooks(repo_root)

0 commit comments

Comments
 (0)