Skip to content

Commit 95ac3b1

Browse files
committed
Fix CI for the release branch
The pre-commit CI job on this branch never actually ran (it always died at `pip install .`, which cannot resolve the not-yet-published pixano-inference-client), so lint/type/format debt and a few real CI-config problems went undetected. Fix them all: - pre-commit (lint_and_format): drop `pip install .` — the hooks run in isolated environments and do not need the package installed. Exclude the example deployment scripts in deploy/ from ruff (force-exclude) and mypy, add types-requests to the mypy hook, and .prettierignore the hand-managed CLAUDE.md. Reformat the Phase 5/6 docs + docker-compose with Prettier, and the docker/models.py import order with ruff. - OpenAPI check: move it into its own job that runs against the locked environment (uv sync), so it is deterministic — a fresh pip resolve pulls a newer FastAPI that emits a slightly different schema than the committed one. - Ray Serve integration + backend: install torch AND torchvision from the same CPU index so their compiled ops stay ABI-coherent (open_clip pulled a PyPI torchvision against the CPU-index torch -> "operator torchvision::nms does not exist"). - Docker: `uv pip install .` resolves the client via [tool.uv.sources] but installs it editable (a path into /build), which the runtime stage's venv copy loses; reinstall it as a real package so it survives the copy. - docs / publish: install the client editable before `.[docs]` (hard core dep, not yet on PyPI).
1 parent dc2e39d commit 95ac3b1

14 files changed

Lines changed: 77 additions & 35 deletions

.github/workflows/docs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
mkdocs-material-
5050
5151
- name: Install dependencies
52-
run: pip install .[docs]
52+
run: |
53+
pip install -e packages/pixano-inference-client # hard core dep, not yet on PyPI
54+
pip install .[docs]
5355
5456
- name: Publish documentation website
5557
run: mike deploy --push --update-aliases latest

.github/workflows/lint_and_format.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ jobs:
4848
python-version: ${{ matrix.python-version }}
4949
cache: "pip"
5050

51-
# Install PyTorch and TensorFlow CPU versions manually to prevent installing CUDA
52-
# Install SAM and MobileSAM manually as they cannot be included in PyPI
51+
# The pre-commit hooks (ruff, mypy via mirrors, license check) run in isolated
52+
# environments and do not need the project installed — so we skip `pip install .`
53+
# (which could not resolve the not-yet-published pixano-inference-client anyway).
5354
- name: Install dependencies
5455
run: |
5556
python -m pip install --upgrade pip
56-
python -m pip install .
5757
pip install pre-commit
5858
5959
- name: Run pre-commit

.github/workflows/publish.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ jobs:
111111
mkdocs-material-
112112
113113
- name: Install dependencies
114-
run: pip install .[docs]
114+
run: |
115+
pip install -e packages/pixano-inference-client # hard core dep, not yet on PyPI
116+
pip install .[docs]
115117
116118
- name: Publish documentation website
117119
run: mike deploy --push --update-aliases ${{ env.VERSION }} stable

.github/workflows/test_back.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ jobs:
5454
- name: Install dependencies
5555
run: |
5656
python -m pip install --upgrade pip
57-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
57+
# Install torch AND torchvision from the same CPU index so their compiled ops stay
58+
# ABI-coherent (open_clip / transformers pull torchvision; a PyPI torchvision against
59+
# a CPU-index torch breaks with "operator torchvision::nms does not exist").
60+
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
5861
# The client is a hard core dep not yet on PyPI, so install it editable BEFORE `pip install .`.
5962
python -m pip install -e packages/pixano-inference-client
6063
python -m pip install .[test,transformers]
@@ -89,7 +92,8 @@ jobs:
8992
- name: Install dependencies
9093
run: |
9194
python -m pip install --upgrade pip
92-
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
95+
# torch + torchvision from the same index (open_clip needs matching torchvision ops).
96+
python -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
9397
python -m pip install -e packages/pixano-inference-client # hard core dep, not yet on PyPI
9498
python -m pip install .[test]
9599
python -m pip install -e examples/numpy_detector # example entry-point plugin
@@ -168,9 +172,28 @@ jobs:
168172
python -m pip install -e examples/numpy_detector
169173
pytest tests/test_plugins.py -v
170174
175+
openapi:
176+
name: OpenAPI schema in sync
177+
runs-on: ubuntu-latest
178+
steps:
179+
- name: Checkout repository
180+
uses: actions/checkout@v4
181+
182+
# Generate the schema in the LOCKED environment (uv.lock) so the check is deterministic:
183+
# a fresh `pip install` resolves newer FastAPI/pydantic that emit a subtly different schema
184+
# than the committed docs/openapi.json (which is generated against the lockfile).
185+
- name: Install uv
186+
uses: astral-sh/setup-uv@v5
187+
188+
- name: Set up Python
189+
uses: actions/setup-python@v5
190+
with:
191+
python-version: "3.12"
192+
171193
- name: Check the committed OpenAPI schema is in sync
172194
run: |
173-
python scripts/gen_openapi.py --check
195+
uv sync --no-default-groups
196+
uv run python scripts/gen_openapi.py --check
174197
175198
client_standalone:
176199
name: Standalone client (no server deps)

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ repos:
3636
rev: v1.13.0
3737
hooks:
3838
- id: mypy
39-
exclude: ^(docs|tests)/
39+
# deploy/ holds example deployment scripts (referencing optional plugin packages),
40+
# not library code — linted like docs/tests are excluded.
41+
exclude: ^(docs|tests|deploy)/
42+
additional_dependencies:
43+
- types-requests
4044
- repo: local
4145
hooks:
4246
- id: check_license_header

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AI-assistant project instructions; managed by hand, excluded from formatting (as in the
2+
# license-header check).
3+
CLAUDE.md

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ and observability.
2121

2222
> **Upgrading:** the HTTP API and the Python client are intentionally breaking. Server operators
2323
> install `pixano-inference` (optionally with `[sam]`, `[clip]`, `[transformers]`); apps that
24-
> only *call* a server should install the new lightweight **`pixano-inference-client`** instead.
24+
> only _call_ a server should install the new lightweight **`pixano-inference-client`** instead.
2525
2626
### ⚠️ Breaking changes
2727

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ RUN --mount=type=cache,target=/root/.cache/uv \
5454
# for both and their CUDA builds stay ABI-coherent (torchvision is required by
5555
# transformers and sam-2).
5656
if [ -n "${TORCH_INDEX_URL}" ]; then uv pip install torch torchvision --index-url "${TORCH_INDEX_URL}"; fi; \
57-
# The lightweight client is a hard core dependency; install it from the bundled source first
58-
# (it is not on PyPI at build time) so the core install below resolves it locally.
59-
uv pip install ./packages/pixano-inference-client; \
57+
# The lightweight client is a hard core dependency not on PyPI at build time; `uv pip install .`
58+
# resolves it via [tool.uv.sources] but installs it EDITABLE (a path into /build), which breaks
59+
# once the runtime stage copies only /opt/venv. So install core, then reinstall the client as a
60+
# real (copied) package so it survives the multi-stage copy.
6061
if [ -n "${PIXANO_EXTRAS}" ]; then uv pip install ".[${PIXANO_EXTRAS}]"; else uv pip install .; fi; \
62+
uv pip install --force-reinstall --no-deps ./packages/pixano-inference-client; \
6163
if [ "${INSTALL_SAM}" = "true" ]; then \
6264
uv pip install ./packages/pixano-inference-sam "sam-2 @ git+https://github.com/facebookresearch/sam2.git@${SAM2_REF}"; \
6365
fi; \

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ services:
3131
# Optional: local images to serve by path (read-only). The host dir must exist and be
3232
# readable by uid 1000; also set PIXANO_INFERENCE_MEDIA_ROOTS above.
3333
# - ./media:/data/media:ro
34-
command: ["--host", "0.0.0.0", "--port", "7463", "--config", "/config/models.py"]
34+
command:
35+
["--host", "0.0.0.0", "--port", "7463", "--config", "/config/models.py"]
3536
# Reap Ray's child processes (Python is PID 1 and is not an init).
3637
init: true
3738
restart: unless-stopped

docker/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
models you need. Weights are cached under /data/hf (the persistent volume).
1111
"""
1212

13-
from pixano_inference.configs import DeploymentConfig, ModelConfig
1413
from pixano_inference_sam import Sam2ImageParams
1514

15+
from pixano_inference.configs import DeploymentConfig, ModelConfig
16+
1617

1718
models = [
1819
ModelConfig(

0 commit comments

Comments
 (0)