Skip to content

fix(deps): declare pytest-timeout required by the pytest addopts - #248

Merged
OmarB97 merged 1 commit into
mainfrom
fix/pytest-timeout-dep
Jun 24, 2026
Merged

fix(deps): declare pytest-timeout required by the pytest addopts#248
OmarB97 merged 1 commit into
mainfrom
fix/pytest-timeout-dep

Conversation

@OmarB97

@OmarB97 OmarB97 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Makes pytest actually start in CI. The fork's [tool.pytest.ini_options] addopts adds --timeout=30 --timeout-method=thread (upstream has neither), but pytest-timeout was never declared as a dependency. Every pytest invocation aborts at startup:

__main__.py: error: unrecognized arguments: --timeout=30 --timeout-method=thread

This was hidden until now: the Python jobs used to die earlier, at uv sync --locked (the lockfile drift fixed in #247). With install unblocked, test (1)test (6) and the e2e "Packaged-wheel i18n smoke test" all run pytest — and now hit the missing-plugin error.

Related Issue

Follow-up to #247. That PR unblocked dependency install; this one fixes the next layer (pytest can't start without the plugin its own addopts requires).

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • pyproject.toml — add pytest-timeout==2.4.0 to the dev optional-dependencies (next to pytest/pytest-asyncio). 2.4.0 resolves cleanly against the pinned pytest==9.0.2.
  • uv.lock — regenerated (uv lock): adds the pytest-timeout entry + references, no other churn.

How to Test

uv sync --locked --python 3.11 --extra dev
# Exact command the e2e job runs (was: "unrecognized arguments: --timeout"):
uv run python -m pytest -m integration tests/test_wheel_locales_e2e.py -v

Locally (macOS): pytest now starts and runs — test_built_sdist_ships_locale_catalogs passes; test_installed_wheel_renders_i18n_strings builds a wheel then dies in ensurepip with SIGABRT, which is a known uv-managed-CPython/macOS quirk in the throwaway venv, not related to this change. On Linux CI (standard Python) that step works, and the test never ran on the fork before because pytest couldn't start. CI on this PR is the real check.

Checklist

Code

  • My commit messages follow Conventional Commits (fix(deps))
  • I searched existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix
  • Tests: this restores the ability to run the pytest suites at all; the suites themselves are the coverage (CI runs them)
  • I've tested on my platform: macOS 15 (Darwin 25.6) — pytest startup verified
  • uv lock --check passes

Documentation & Housekeeping

  • Docs / config / AGENTS.md / cross-platform / schemas — N/A (single dev-dependency declaration)

Screenshots / Logs

Before (this branch's base, from the #247 run's e2e job):

python -m pytest -m integration tests/test_wheel_locales_e2e.py -v
__main__.py: error: unrecognized arguments: --timeout=30 --timeout-method=thread
##[error]Process completed with exit code 4.

After: 2 tests collected / pytest starts normally.

The fork's `[tool.pytest.ini_options] addopts` adds `--timeout=30
--timeout-method=thread` (upstream has neither), but `pytest-timeout` was never
added to the dev dependencies. So every pytest run aborts at startup with
`unrecognized arguments: --timeout` as soon as it actually gets to run — which
`test (1..6)` and the `e2e` "Packaged-wheel i18n smoke test" now do, after the
uv.lock sync in #247 unblocked dependency install (the install failure had been
masking this).

Add `pytest-timeout==2.4.0` (resolves cleanly against pytest 9.0.2) and lock.

Verified locally: `python -m pytest -m integration tests/test_wheel_locales_e2e.py`
now starts and collects/runs both tests instead of erroring on the unknown arg.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔎 Lint report: fix/pytest-timeout-dep vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 10912 on HEAD, 10910 on base (🆕 +2)

🆕 New issues (2):

Rule Count
unresolved-attribute 2
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:3004: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`

✅ Fixed issues (1):

Rule Count
invalid-assignment 1
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`

Unchanged: 5711 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@OmarB97
OmarB97 merged commit f6a8d67 into main Jun 24, 2026
33 of 36 checks passed
OmarB97 added a commit that referenced this pull request Jul 11, 2026
…ne -> green main (#262)

Head-of-main CI is red on `Check uv.lock / uv lock --check`, all 8
`Python tests / Run tests slice N/8`, and `Python tests / e2e`. Root cause is a
uv.lock <-> pyproject.toml inconsistency (not a test-logic failure): every slice
and e2e install via `uv sync --locked`, which hard-fails on a stale lockfile.

Two stale entries, both pre-dating the five fork-ship merges (#257-#261, none of
which touched pyproject.toml/uv.lock):
  1. pytest-timeout==2.4.0 - the fork's pytest addopts use
     `--timeout=30 --timeout-method=thread` (needs the plugin); PR #248 declared it
     in the `dev` extra, but the v0.18.2 upstream merge (ba510aa) dropped that
     declaration while keeping the addopts and the lock entry.
  2. A vestigial `{ name = "pillow", marker = "extra == 'vision'" }` line in uv.lock,
     left over from Pillow's promotion to a core dependency (`vision = []`).

Fix: re-declare pytest-timeout==2.4.0 in the dev extra (reverts the merge drop; the
existing lock entry is already correct) and regenerate uv.lock to drop the stale
pillow vision-marker line. Net: +1 pyproject dep, -1 uv.lock line.

Verified locally: `uv lock --check` clean; `uv sync --locked --python 3.11 --extra dev`
installs; pytest_timeout plugin registered and a trivial test passes under the repo
addopts (1 passed) - i.e. `--timeout` is accepted instead of aborting on an unknown arg.

Co-authored-by: Omar Baradei <omar@kostudios.io>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
OmarB97 added a commit that referenced this pull request Jul 20, 2026
…ne -> green main (#262)

Head-of-main CI is red on `Check uv.lock / uv lock --check`, all 8
`Python tests / Run tests slice N/8`, and `Python tests / e2e`. Root cause is a
uv.lock <-> pyproject.toml inconsistency (not a test-logic failure): every slice
and e2e install via `uv sync --locked`, which hard-fails on a stale lockfile.

Two stale entries, both pre-dating the five fork-ship merges (#257-#261, none of
which touched pyproject.toml/uv.lock):
  1. pytest-timeout==2.4.0 - the fork's pytest addopts use
     `--timeout=30 --timeout-method=thread` (needs the plugin); PR #248 declared it
     in the `dev` extra, but the v0.18.2 upstream merge (ba510aa) dropped that
     declaration while keeping the addopts and the lock entry.
  2. A vestigial `{ name = "pillow", marker = "extra == 'vision'" }` line in uv.lock,
     left over from Pillow's promotion to a core dependency (`vision = []`).

Fix: re-declare pytest-timeout==2.4.0 in the dev extra (reverts the merge drop; the
existing lock entry is already correct) and regenerate uv.lock to drop the stale
pillow vision-marker line. Net: +1 pyproject dep, -1 uv.lock line.

Verified locally: `uv lock --check` clean; `uv sync --locked --python 3.11 --extra dev`
installs; pytest_timeout plugin registered and a trivial test passes under the repo
addopts (1 passed) - i.e. `--timeout` is accepted instead of aborting on an unknown arg.

Co-authored-by: Omar Baradei <omar@kostudios.io>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant