Skip to content

ENH: only run diffed content #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,27 @@ notebook_files=()

# Find Markdown files convert.
all_markdown_files=$(find tutorials -type f -name "*.md")

if [ $# -gt 0 ]; then
files_to_process="$@"
echo "INFO: Testing only a subset of notebooks"
if [[ "$1" == --changed ]]; then
# We only want to run tests for the notebooks we touched compared to `branch`
# provided in the second argument.
branch=$2
files_to_process=$(git fetch ${branch} --depth=1; git diff ${branch} --name-only tutorials | grep .md)

else
files_to_process="$@"
fi

else
echo "INFO: Testing all the notebooks"
files_to_process=$all_markdown_files

fi

# Identify Markdown files that are Jupytext and convert them all.
for file in ${files_to_process}; do
echo loop in $file
# Extract the kernel information from the Jupytext Markdown file.
kernel_info=$(grep -A 10 '^---$' "$file" | grep -E 'kernelspec')
# Skip if no kernel information was found.
Expand Down