Skip to content

pre_executed directory is not excluded from pre-commit's sphinx-build #543

Description

@hombit

Reproducible example, it uses v2.0.7 because of #542

# Initialize a new project
copier copy gh:lincc-frameworks/python-project-template -r v2.0.7 new_project
## Select simple and and answer other questions 
cd new_project
python3 -mvenv ~/.virtualenvs/new_project && source ~/.virtualenvs/new_project/bin/activate
bash .initialize_new_project.sh

# Create a notebook which creates Hello.text file on run
python -m pip install jupytext
echo 'print("Hello, world!")' > hello_world.py
python -m jupytext --to ipynb --output docs/pre_executed/hello_world.ipynb hello_world.py
# Test that the does NOT exist
test -f Hello.text && exit 1
test -f docs/pre_executed/Hello.text && exit 1

# Commit and see that notebook has been run
git switch -c new-branch
git add docs/pre_executed/hello_world.ipynb
git commit -m "Hello"

# Fail appeared 
test -f docs/pre_executed/Hello.text && exit 1  # FAILS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions