Visitar URL original
Move protobuf requirement to pyproject.toml by C-Achard · Pull Request #3235 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion .github/versioning/tf-ci-constraints.txt

This file was deleted.

45 changes: 33 additions & 12 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,32 +124,53 @@ jobs:
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install ffmpeg || true
fi

- name: Install ffmpeg (Windows, BtbN build)
- name: Install ffmpeg (Windows, BtbN latest)
if: runner.os == 'Windows'
shell: pwsh
env:
FFMPEG_TAG: autobuild-2026-03-31-13-11
FFMPEG_ASSET: ffmpeg-master-latest-win64-gpl-shared.zip
FFMPEG_SHA256: 084537f4fc8f4a6c6509fc7d25b74df715994107e635a7aee94cdeee054dcac4
run: |
$ErrorActionPreference = "Stop"
$url = "https://github.com/BtbN/FFmpeg-Builds/releases/download/$env:FFMPEG_TAG/$env:FFMPEG_ASSET"
$zip = Join-Path $env:RUNNER_TEMP $env:FFMPEG_ASSET
$dest = Join-Path $env:RUNNER_TEMP "ffmpeg"

$asset = $env:FFMPEG_ASSET
$baseUrl = "https://github.com/BtbN/FFmpeg-Builds/releases/latest/download"
$url = "$baseUrl/$asset"
$checksumsUrl = "$baseUrl/checksums.sha256"

$tmpRoot = Join-Path $env:RUNNER_TEMP "ffmpeg-install"
$zip = Join-Path $tmpRoot $asset
$checksums = Join-Path $tmpRoot "checksums.sha256"
$dest = Join-Path $tmpRoot "ffmpeg"

if (Test-Path $tmpRoot) { Remove-Item -Recurse -Force $tmpRoot }
New-Item -ItemType Directory -Path $tmpRoot | Out-Null

Invoke-WebRequest -Uri $url -OutFile $zip
Invoke-WebRequest -Uri $checksumsUrl -OutFile $checksums

$actual = (Get-FileHash -Path $zip -Algorithm SHA256).Hash.ToLowerInvariant()
$expected = $env:FFMPEG_SHA256.ToLowerInvariant()
$expected = Get-Content -Path $checksums |
ForEach-Object {
if ($_ -match '^(?<sha>[0-9A-Fa-f]{64})\s+\*?(?<name>.+)$' -and $matches.name.Trim() -eq $asset) {
$matches.sha.ToLowerInvariant()
}
} |
Select-Object -First 1

if (-not $expected) {
throw "Could not find checksum for $asset in $checksums"
}

$actual = (Get-FileHash -Path $zip -Algorithm SHA256).Hash.ToLowerInvariant()
if ($actual -ne $expected) {
throw "FFmpeg checksum mismatch. Expected $expected but got $actual"
}
if (Test-Path $dest) { Remove-Item -Recurse -Force $dest }

Expand-Archive -Path $zip -DestinationPath $dest -Force
$ffdir = Get-ChildItem $dest -Directory | Select-Object -First 1
"$($ffdir.FullName)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$ffdir = Get-ChildItem -Path $dest -Directory | Select-Object -First 1
if (-not $ffdir) { throw "Could not find extracted FFmpeg directory." }

$binDir = Join-Path $ffdir.FullName "bin"
$binDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Verify ffmpeg/ffprobe available
shell: bash -el {0}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ docs = [
]
fmpose3d = [ "fmpose3d>=0.0.8" ]
tf = [
"protobuf<7",
# !!! TensorFlow is not supported on Windows with Python >= 3.11
"tensorflow>=2,<=2.10; platform_system=='Windows' and python_version<'3.11'",
"tensorflow>=2,<2.12; platform_system=='Linux' and python_version<'3.11'",
Expand Down
10 changes: 2 additions & 8 deletions tests/tools/test_selector/test_selector_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,11 @@ def test_fast_multianimal_includes_functional(selector):
assert "multianimal" in res.provenance.scripts["examples/testscript_tensorflow_multi_animal.py"]


def test_fast_ci_workflows_uses_minimal_pytest(selector):
def test_fast_ci_workflows_uses_full_suite(selector):
files = [".github/workflows/ci.yml"]
res = selector.decide(files)

assert_lanes(res, fast=True)

# ci_workflows explicitly maps to the minimal pytest path
assert selector.MINIMAL_PYTEST[0] in res.pytest_paths
assert res.lane_reasons["fast"] == ["category:ci_workflows"]
assert res.provenance.pytest[selector.MINIMAL_PYTEST[0]] == ["ci_workflows"]
assert_lanes(res, full=True)


def test_no_category_matched_is_full(selector):
Expand Down Expand Up @@ -324,7 +319,6 @@ def test_required_category_rules_exist():
names = {rule.name for rule in CATEGORY_RULES}
assert "docs" in names
assert "core" in names
assert "ci_workflows" in names


def test_docs_rule_exists_once():
Expand Down
17 changes: 9 additions & 8 deletions tools/test_selector_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ def validate_category_rules(rules: list[CategoryRule]) -> list[CategoryRule]:
("pyproject.toml changed", equals("pyproject.toml")),
("lockfile changed", suffix(".lock")),
("DEEPLABCUT.yaml changed", suffix("DEEPLABCUT.yaml")),
("CI workflow changed", prefix(".github/workflows/")),
]


Expand Down Expand Up @@ -318,14 +319,14 @@ def validate_category_rules(rules: list[CategoryRule]) -> list[CategoryRule]:
functional_scripts=[],
),
# CI & TOOLING #
CategoryRule(
name="ci_workflows",
match_any=[
prefix(".github/workflows/"),
],
pytest_paths=MINIMAL_PYTEST,
functional_scripts=[],
),
# CategoryRule(
# name="ci_workflows",
# match_any=[
# prefix(".github/workflows/"),
# ],
# pytest_paths=MINIMAL_PYTEST,
# functional_scripts=[],
# ),
CategoryRule(
name="ci_tools",
match_any=[
Expand Down
Loading
Loading