Skip to content

Commit 9367376

Browse files
fix: ignore hidden folders created by jupyterlab during build
1 parent e8d1b5d commit 9367376

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,4 @@ tests/data/
209209

210210
!afterpython/_website/src/lib/
211211

212-
.python-version
213-
214212
afterpython/_website.backup/

src/afterpython/builders/url_md.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ def _publish_for_type(content_type: tContentType) -> int:
7474

7575
count = 0
7676
for source in sorted(source_dir.rglob("*")):
77-
if "_build" in source.parts:
77+
# Skip MyST build output and any hidden tool directory. The latter is
78+
# essential: jupyterlab-lsp writes `.virtual_documents/*.ipynb` and
79+
# jupyter writes `.ipynb_checkpoints/*.ipynb` — these carry an `.ipynb`
80+
# extension but are NOT notebooks (the virtual-documents ones are raw
81+
# Python source), so jupytext.read() chokes on them.
82+
if "_build" in source.parts or any(p.startswith(".") for p in source.parts):
7883
continue
7984
if not source.is_file():
8085
continue

0 commit comments

Comments
 (0)