Visitar URL original
install knowlegde-index dependency group for testing · DeepLabCut/DeepLabCut@cc4ae4a · GitHub
Skip to content

Commit cc4ae4a

Browse files
authored
install knowlegde-index dependency group for testing
separate knowledge-index and dev dependency groups were designed to keep CI lean, but after expanding tests, running tests without knowledge-index is not feasible anyway so we're adding it - add `--group knowledge-index` in `intelligent-testing.yml` workflow (required to run all tests in tests/tools) - revert adding markdown-it-py in dev dependencies, it belongs in the knowledge-index group, which is installed now anyway during testing - revert the docutils lazy importing (which did not buy us anything)
1 parent 18334ca commit cc4ae4a

5 files changed

Lines changed: 11 additions & 15 deletions

File tree

‎.github/workflows/intelligent-testing.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ jobs:
178178
python -m ensurepip --upgrade
179179
python -m pip install --upgrade pip setuptools wheel
180180
python -m pip install dependency-groups
181-
python -m pip install --no-cache-dir -e ".${{ matrix.extras }}" --group dev
181+
# knowledge-index: tests/tools/knowledge_indexing exercises the real
182+
# extractors, which import griffe, docutils and markdown-it.
183+
python -m pip install --no-cache-dir -e ".${{ matrix.extras }}" --group dev --group knowledge-index
182184
183185
- name: Run TensorFlow install smoke test
184186
shell: bash -el {0}

‎.github/workflows/python-package.yml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ jobs:
102102
python -m ensurepip --upgrade
103103
python -m pip install --upgrade pip setuptools wheel
104104
python -m pip install dependency-groups
105-
python -m pip install --no-cache-dir -e ".${{ matrix.extras }}" --group dev
105+
# knowledge-index: tests/tools/knowledge_indexing exercises the real
106+
# extractors, which import griffe, docutils and markdown-it.
107+
python -m pip install --no-cache-dir -e ".${{ matrix.extras }}" --group dev --group knowledge-index
106108
107109
- name: Install ffmpeg (Linux/macOS)
108110
if: runner.os != 'Windows'

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ Documentation = "https://deeplabcut.github.io/DeepLabCut/README.html"
151151
# Groups, not extras: Install with `pip install --group <name>`
152152
dev = [
153153
"coverage",
154-
"markdown-it-py",
155154
"nbformat>5",
156155
"pre-commit",
157156
"pytest",

‎tools/knowledge_indexing/docs_index.py‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from typing import Any
3131

3232
import yaml
33+
from docutils.nodes import make_id
3334
from markdown_it import MarkdownIt
3435
from markdown_it.token import Token
3536

@@ -404,19 +405,13 @@ def _link_targets(tokens: list[Token]) -> list[str]:
404405

405406

406407
def _anchor(text: str) -> str:
407-
"""Heading anchor, as Sphinx publishes it.
408+
"""Slug for a heading, used to name its record, not to address it.
408409
409-
`make_id` is what docutils uses to turn a heading into a section id: it drops
410+
Published anchors come from `read_published_anchors`. `make_id` drops
410411
non-ASCII, collapses everything else to hyphens and trims leading digits, so
411-
"(1) Create a New 3D Project:" anchors as `create-a-new-3d-project` and
412-
"DeepLabCut's role" as `deeplabcuts-role`.
413-
414-
Imported here rather than at module level: docutils is the one build
415-
dependency a plain dev install does not already have, and it is needed only
416-
to run a build, not to import this module.
412+
"(1) Create a New 3D Project:" becomes `create-a-new-3d-project` and
413+
"DeepLabCut's role" becomes `deeplabcuts-role`.
417414
"""
418-
from docutils.nodes import make_id
419-
420415
return make_id(text)
421416

422417

‎uv.lock‎

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)