Skip to content

Commit 0406081

Browse files
authored
Merge branch 'develop' into fix/video-worker-error-propagation
2 parents 2fccbf8 + 95ef33a commit 0406081

File tree

12 files changed

+63
-27
lines changed

12 files changed

+63
-27
lines changed

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ jobs:
2929
python-version: ["3.10"]
3030
steps:
3131
- name: 📥 Checkout the repository
32-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
32+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3333
with:
3434
fetch-depth: 0
3535

3636
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
37-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
37+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040
activate-environment: true
4141

4242

4343
- name: 🔑 Create GitHub App token (mkdocs)
4444
id: mkdocs_token
45-
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
45+
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
4646
with:
4747
app-id: ${{ secrets.MKDOCS_APP_ID }}
4848
private-key: ${{ secrets.MKDOCS_PEM }}

.github/workflows/publish-pre-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
python-version: ["3.10"]
2727
steps:
2828
- name: 📥 Checkout the repository
29-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
3030

3131
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
32-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
32+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535
activate-environment: true

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
python-version: ["3.10"]
2525
steps:
2626
- name: 📥 Checkout the repository
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2828

2929
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
30-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
30+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
activate-environment: true

.github/workflows/publish-testpypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
python-version: ["3.10"]
2222
steps:
2323
- name: 📥 Checkout the repository
24-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2525

2626
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
27-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
27+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2828
with:
2929
python-version: ${{ matrix.python-version }}
3030
activate-environment: true

.github/workflows/test-doc.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: 🧪 Docs Test WorkFlow 📚
22

33
on:
4+
push:
5+
branches: [main, develop]
46
pull_request:
57
branches: [main, develop]
68

9+
concurrency:
10+
group: docs-test-${{ github.ref }}
11+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
12+
713
# Restrict permissions by default
814
permissions:
915
contents: read # Required for checkout
@@ -19,12 +25,12 @@ jobs:
1925
python-version: ["3.10"]
2026
steps:
2127
- name: 📥 Checkout the repository
22-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2329
with:
2430
fetch-depth: 0
2531

2632
- name: 🐍 Install uv and set Python ${{ matrix.python-version }}
27-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
33+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2834
with:
2935
python-version: ${{ matrix.python-version }}
3036
activate-environment: true

.github/workflows/uv-test.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
name: 🔧 Pytest/Test Workflow
22

33
on:
4+
push:
5+
branches: [main, develop]
46
pull_request:
57
branches: [main, develop]
68

9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: pytest-test-${{ github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
716
jobs:
817
run-tests:
918
name: Import Test and Pytest Run
@@ -16,15 +25,14 @@ jobs:
1625
runs-on: ${{ matrix.os }}
1726
steps:
1827
- name: 📥 Checkout the repository
19-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2029

2130
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
22-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
31+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6
2332
with:
2433
python-version: ${{ matrix.python-version }}
2534
activate-environment: true
2635

27-
2836
- name: 🚀 Install Packages
2937
run: uv pip install -r pyproject.toml --group dev --group docs --extra metrics
3038

@@ -33,3 +41,25 @@ jobs:
3341

3442
- name: 🧪 Run the Test
3543
run: uv run pytest
44+
45+
46+
testing-guardian:
47+
runs-on: ubuntu-latest
48+
needs: run-tests
49+
if: always()
50+
steps:
51+
- name: Display test result
52+
run: echo "${{ needs.run-tests.result }}"
53+
- name: Fail guardian on test failure
54+
if: needs.run-tests.result == 'failure'
55+
run: exit 1
56+
# Ensure that cancelled or skipped test runs still cause this guardian job to fail,
57+
# using an explicit exit code instead of relying on timeout behavior.
58+
- name: cancelled or skipped...
59+
if: contains(fromJSON('["cancelled", "skipped"]'), needs.run-tests.result)
60+
run: |
61+
echo "run-tests job result is '${{ needs.run-tests.result }}'; failing explicitly."
62+
exit 1
63+
- name: tests succeeded
64+
if: needs.run-tests.result == 'success'
65+
run: echo "All tests completed successfully in job 'run-tests'."

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ci:
77

88
repos:
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v5.0.0
10+
rev: v6.0.0
1111
hooks:
1212
- id: trailing-whitespace
1313
exclude: test/.*\.py
@@ -25,17 +25,17 @@ repos:
2525
- id: mixed-line-ending
2626

2727
- repo: https://github.com/PyCQA/bandit
28-
rev: '1.8.6'
28+
rev: '1.9.2'
2929
hooks:
3030
- id: bandit
3131
args: ["-c", "pyproject.toml"]
3232
additional_dependencies: ["bandit[toml]"]
3333

3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: v0.12.5
35+
rev: v0.14.10
3636
hooks:
37-
- id: ruff
38-
args: [--fix, --exit-non-zero-on-fix]
37+
- id: ruff-check
38+
args: [--fix]
3939
- id: ruff-format
4040
types_or: [ python, pyi, jupyter ]
4141

@@ -55,7 +55,7 @@ repos:
5555
- tomli
5656

5757
- repo: https://github.com/asottile/pyupgrade
58-
rev: v3.20.0
58+
rev: v3.21.2
5959
hooks:
6060
- id: pyupgrade
6161
args: ["--py310-plus"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ dev = [
7373
docs = [
7474
"mkdocs-material[imaging]>=9.5.5",
7575
"mkdocstrings>=0.25.2,<0.31.0",
76-
"mkdocstrings-python>=1.10.9",
76+
"mkdocstrings-python>=1.10.9, <2.0.0", # todo: breaking changes in 2.x
7777
"mike>=2.0.0",
7878
"mkdocs-jupyter>=0.24.3",
7979
"mkdocs-git-committers-plugin-2>=2.4.1; python_version >= '3.9' and python_version < '4'",

supervision/annotators/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ def annotate(
764764
"""
765765
assert isinstance(scene, np.ndarray)
766766
for detection_idx in range(len(detections)):
767-
x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int)
767+
x1, _y1, x2, y2 = detections.xyxy[detection_idx].astype(int)
768768
color = resolve_color(
769769
color=self.color,
770770
detections=detections,
@@ -1621,7 +1621,7 @@ def _draw_labels(
16211621
)
16221622

16231623
# Move to the next line position
1624-
left, top, right, bottom = draw.textbbox((0, 0), line, font=self.font)
1624+
_left, top, _right, bottom = draw.textbbox((0, 0), line, font=self.font)
16251625
line_height = bottom - top
16261626
y_position += line_height + self.text_padding
16271627

@@ -1917,7 +1917,7 @@ def annotate(
19171917

19181918
if len(xy) > 3 and self.smooth:
19191919
x, y = xy[:, 0], xy[:, 1]
1920-
tck, u = splprep([x, y], s=20)
1920+
tck, _u = splprep([x, y], s=20)
19211921
x_new, y_new = splev(np.linspace(0, 1, 100), tck)
19221922
spline_points = np.stack([x_new, y_new], axis=1).astype(np.int32)
19231923

supervision/detection/utils/masks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def calculate_masks_centroids(masks: np.ndarray) -> np.ndarray:
100100
A 2D NumPy array of shape (num_masks, 2), where each row contains the x and y
101101
coordinates (in that order) of the centroid of the corresponding mask.
102102
"""
103-
num_masks, height, width = masks.shape
103+
_num_masks, height, width = masks.shape
104104
total_pixels = masks.sum(axis=(1, 2))
105105

106106
# offset for 1-based indexing

0 commit comments

Comments
 (0)