Visitar URL original
Merge branch 'main' into refactor/predict-multianimal · DeepLabCut/DeepLabCut@8d9c33b · GitHub
Skip to content

Commit 8d9c33b

Browse files
authored
Merge branch 'main' into refactor/predict-multianimal
2 parents cc25c74 + a405438 commit 8d9c33b

127 files changed

Lines changed: 15633 additions & 2655 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.circleci/config.yml‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ jobs:
1515
- restore_cache:
1616
name: Restore uv cache
1717
keys:
18-
- v1-uv-{{ checksum "pyproject.toml" }}
19-
- v1-uv-
20-
# 2) Install deps with uv via the Python orb (simple)
21-
- python/install-packages:
22-
pkg-manager: uv
23-
# args: "--locked" # enable this if you commit uv.lock for strict CI installs
18+
- v2-uv-pip-{{ checksum "pyproject.toml" }}
19+
- v2-uv-pip-
20+
# 2) Install uv
21+
- run:
22+
name: Install uv
23+
command: |
24+
pip install uv
25+
26+
- run:
27+
name: Install DeepLabCut runtime deps only
28+
command: |
29+
uv pip install --system -e .
2430
2531
# 3) (Optional) Trim the cache for CI so uploads stay small and fast
2632
- run:
@@ -30,16 +36,16 @@ jobs:
3036
# 4) Save the cache for next runs
3137
- save_cache:
3238
name: Save uv cache
33-
key: v1-uv-{{ checksum "pyproject.toml" }}
39+
key: v2-uv-pip-{{ checksum "pyproject.toml" }}
3440
paths:
3541
- ~/.cache/uv
3642

3743
- run:
3844
name: TestDLC
3945
# uv handles the installation of the dependencies
40-
command: uv run python testscript_cli.py
46+
command: python testscript_cli.py
4147

4248
workflows:
4349
main:
4450
jobs:
45-
- build-and-test
51+
- build-and-test

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ body:
2525
attributes:
2626
label: DeepLabCut version
2727
description: What version of DLC are you using? Please check with `import deeplabcut`, `deeplabcut.__version__`
28-
placeholder: 3.0.0rc9
28+
placeholder: 3.0.0rc14
2929
validations:
3030
required: true
3131
- type: dropdown

‎.github/workflows/build-book.yml‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build (and optionally deploy) Jupyter Book
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
python-version:
7+
description: "Python version used to build the docs."
8+
required: false
9+
default: "3.10"
10+
type: string
11+
build_dir:
12+
required: false
13+
default: "./_build/html"
14+
type: string
15+
upload_artifact:
16+
description: "If true, upload the built site as an artifact."
17+
required: false
18+
default: false
19+
type: boolean
20+
21+
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
steps:
29+
- uses: actions/checkout@v6
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v6
33+
with:
34+
python-version: ${{ inputs.python-version }}
35+
36+
- name: Install docs dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install .[docs]
40+
41+
- name: Build the book
42+
run: jupyter-book build .
43+
44+
- name: Upload built site artifact
45+
if: ${{ inputs.upload_artifact }}
46+
uses: actions/upload-artifact@v6
47+
with:
48+
name: built-book
49+
path: ${{ inputs.build_dir }}
50+
if-no-files-found: error
51+
retention-days: 1

‎.github/workflows/codespell.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ on:
55
push:
66
branches: [main]
77
pull_request:
8-
branches: [main]
8+
types: [opened, synchronize, reopened]
9+
branches: [ main ]
910

1011
jobs:
1112
codespell:
@@ -14,7 +15,7 @@ jobs:
1415

1516
steps:
1617
- name: Checkout
17-
uses: actions/checkout@v3
18+
uses: actions/checkout@v6
1819
- name: Annotate locations with typos
1920
uses: codespell-project/codespell-problem-matcher@v1
2021
- name: Codespell
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Docs & notebooks freshness and formatting checks
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
staleness:
14+
name: Docs and notebooks scan (read-only)
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
18+
steps:
19+
- name: Checkout repository (full history for git dates)
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: "3.12"
28+
29+
- name: Install staleness tool dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install "pydantic>=2,<3" pyyaml "nbformat>=5"
33+
34+
- name: Run staleness report (read-only)
35+
run: |
36+
python tools/docs_and_notebooks_check.py \
37+
--config tools/docs_and_notebooks_report_config.yml \
38+
--out-dir tmp/docs_nb_checks \
39+
report
40+
41+
42+
# Optional: run check mode (will fail only once you populate allowlists in config)
43+
- name: Run staleness policy check (optional gate)
44+
continue-on-error: true
45+
run: |
46+
python tools/docs_and_notebooks_check.py \
47+
--config tools/docs_and_notebooks_report_config.yml \
48+
--out-dir tmp/docs_nb_checks \
49+
--no-step-summary \
50+
check
51+
52+
- name: Upload staleness artifacts
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: staleness-report
56+
path: |
57+
tmp/docs_nb_checks/*.json
58+
tmp/docs_nb_checks/*.md
59+
if-no-files-found: error
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: "Intelligent Python Testing"
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
branches: [ main ]
9+
10+
concurrency:
11+
group: intelligent-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || format('run-{0}', github.run_id) }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
intelligent-test-selection:
19+
name: Select test plan
20+
runs-on: ubuntu-latest
21+
outputs:
22+
run_skip: ${{ steps.selector.outputs.run_skip }}
23+
run_docs: ${{ steps.selector.outputs.run_docs }}
24+
run_fast: ${{ steps.selector.outputs.run_fast }}
25+
run_full: ${{ steps.selector.outputs.run_full }}
26+
selected_workflows: ${{ steps.selector.outputs.selected_workflows }}
27+
lane_reasons: ${{ steps.selector.outputs.lane_reasons }}
28+
pytest_paths: ${{ steps.selector.outputs.pytest_paths }}
29+
functional_scripts: ${{ steps.selector.outputs.functional_scripts }}
30+
reasons: ${{ steps.selector.outputs.reasons }}
31+
changed_files: ${{ steps.selector.outputs.changed_files }}
32+
provenance: ${{ steps.selector.outputs.provenance }}
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v6
36+
with:
37+
fetch-depth: 0 # needed for merge-base/diff to be reliable
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@v6
41+
with:
42+
python-version: "3.12"
43+
44+
- name: Run selector + generate report
45+
id: selector
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install "pydantic>=2,<3"
49+
python tools/test_selector.py \
50+
--write-github-output \
51+
--write-summary \
52+
--report-dir tmp/test-selection \
53+
--json
54+
55+
- name: Upload selector report
56+
uses: actions/upload-artifact@v6
57+
with:
58+
name: test-selection-report
59+
path: |
60+
tmp/test-selection/selection.json
61+
tmp/test-selection/decision.md
62+
retention-days: 7
63+
if-no-files-found: error
64+
65+
66+
67+
skip:
68+
name: Skipped (lint config change)
69+
needs: intelligent-test-selection
70+
if: needs.intelligent-test-selection.outputs.run_skip == 'true'
71+
runs-on: ubuntu-latest
72+
steps:
73+
- run: |
74+
echo "Only lint config files changed; skipping docs/tests."
75+
echo "Pre-commit workflow is responsible for lint config validation."
76+
77+
78+
docs:
79+
name: Docs build
80+
needs: intelligent-test-selection
81+
if: needs.intelligent-test-selection.outputs.run_docs == 'true'
82+
uses: ./.github/workflows/build-book.yml
83+
with:
84+
python-version: "3.10"
85+
build_dir: "./_build/html"
86+
upload_artifact: false
87+
secrets: inherit
88+
89+
90+
fast-tests:
91+
name: Fast lane (targeted pytest + selected functional)
92+
needs: intelligent-test-selection
93+
if: needs.intelligent-test-selection.outputs.run_fast == 'true'
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Checkout code
97+
uses: actions/checkout@v6
98+
99+
- name: Setup Python
100+
uses: actions/setup-python@v6
101+
with:
102+
python-version: "3.12"
103+
104+
- name: Install test deps
105+
run: |
106+
python -m pip install --upgrade pip
107+
pip install pytest
108+
pip install -e ".[tf]" --group dev
109+
110+
- name: Run targeted pytest (paths selected by selector)
111+
env:
112+
PYTEST_PATHS: ${{ needs.intelligent-test-selection.outputs.pytest_paths }}
113+
run: |
114+
python - << 'PY'
115+
import json, os, subprocess, sys
116+
paths = json.loads(os.environ.get("PYTEST_PATHS", "[]"))
117+
if not paths:
118+
print("No pytest paths selected; skipping targeted pytest.")
119+
sys.exit(0)
120+
cmd = ["python", "-m", "pytest"] + paths
121+
print("Running:", " ".join(cmd))
122+
sys.exit(subprocess.call(cmd))
123+
PY
124+
125+
- name: Run selected functional scripts
126+
env:
127+
FUN_SCRIPTS: ${{ needs.intelligent-test-selection.outputs.functional_scripts }}
128+
run: |
129+
python - << 'PY'
130+
import json, os, subprocess, sys
131+
scripts = json.loads(os.environ.get("FUN_SCRIPTS", "[]"))
132+
for s in scripts:
133+
print("Running:", s)
134+
rc = subprocess.call(["python", s])
135+
if rc != 0:
136+
sys.exit(rc)
137+
PY
138+
139+
full-tests:
140+
name: Full matrix tests
141+
needs: intelligent-test-selection
142+
if: needs.intelligent-test-selection.outputs.run_full == 'true'
143+
uses: ./.github/workflows/python-package.yml
144+
with:
145+
concurrency_key: ${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || '' }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Lockfile
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "pyproject.toml"
7+
- "uv.lock"
8+
# - ".python-version"
9+
- ".github/workflows/uv-lockfile-check.yml"
10+
push:
11+
branches: [main]
12+
paths:
13+
- "pyproject.toml"
14+
- "uv.lock"
15+
# - ".python-version"
16+
- ".github/workflows/uv-lockfile-check.yml"
17+
18+
jobs:
19+
uv-lockfile-check:
20+
name: uv.lock is current
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v6
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v6
28+
with:
29+
python-version-file: pyproject.toml
30+
31+
- name: Install uv
32+
uses: astral-sh/setup-uv@v7
33+
with:
34+
version: "0.10.10"
35+
36+
- name: Check lockfile
37+
run: uv lock --check

0 commit comments

Comments
 (0)