fix(ci): revert analyzer to Python <3.14 to fix Poetry resolve hang#2152
Open
RonShakutai wants to merge 3 commits into
Open
fix(ci): revert analyzer to Python <3.14 to fix Poetry resolve hang#2152RonShakutai wants to merge 3 commits into
RonShakutai wants to merge 3 commits into
Conversation
- Add timeout-minutes: 60 at job level for overall test job - Add timeout-minutes: 30 to 'Install dependencies' step to prevent unbounded Poetry dependency resolution - Add --no-interaction flag to poetry install to prevent waiting for user input This fixes CI hanging on 'Resolving dependencies...' step that can hang for hours when Poetry has complex dependency graphs (especially with --all-extras flag)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the CI workflow against indefinite hangs during Poetry dependency resolution by adding explicit timeouts and ensuring Poetry runs non-interactively, improving reliability of the test matrix runs across Presidio components.
Changes:
- Add a job-level timeout (
timeout-minutes: 60) for the matrixtestjob to prevent unbounded runtime. - Add a step-level timeout (
timeout-minutes: 30) specifically for the “Install dependencies” step to cap Poetry resolution time. - Add
--no-interactiontopoetry installto avoid CI waiting on prompts.
Contributor
Coverage report (presidio-anonymizer)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Contributor
Coverage report (presidio-image-redactor)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Contributor
Coverage report (presidio-cli)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Contributor
The analyzer --all-extras CI job hung on 'Resolving dependencies...' on every Python version (3.10-3.13), not just 3.14. Root cause: CI runs `poetry install` with no committed lock, so Poetry computes a *universal* resolve across the whole `requires-python` range. Widening it to <3.15 (#2105) forced the solver to also satisfy 3.14, where optional ML extras have no clean solution (e.g. onnxruntime ships cp314 wheels only for 1.24.1-1.24.3; 1.25+ have none) -> unbounded backtracking on every job. Revert `requires-python` to >=3.10,<3.14, drop the spacy 3.14 marker split, and remove the Python 3.14 analyzer job from the CI matrix. Keeps the previously added timeout-minutes as a safety net. 3.14 can be re-added once the ML extras publish 3.14 wheels. Verified: `poetry lock` for presidio-analyzer now resolves in ~34s instead of hanging. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment on lines
23
to
+27
| include = ["conf/*",] | ||
|
|
||
| requires-python = ">=3.10,<3.15" | ||
| requires-python = ">=3.10,<3.14" | ||
| dependencies = [ | ||
| "spacy (>=3.4.4,!=3.7.0,<4.0.0); python_version < '3.14'", | ||
| "spacy (>=3.4.4,!=3.7.0,!=3.8.14,<4.0.0); python_version >= '3.14'", | ||
| "spacy (>=3.4.4,!=3.7.0,<4.0.0)", |
…racking The analyzer --all-extras resolve is slow because several ML deps declare upper bounds far above what can actually be installed together, so Poetry starts from the newest release of each and backtracks through every incompatible one — a set that keeps growing as upstream publishes new versions (e.g. transformers 5.x, huggingface-hub 1.x released within the last week). Tighten the declared bounds to their effective ceilings so the resolver never explores the doomed space: - transformers <6.0.0 -> <5.0.0 (spacy-huggingface-pipelines requires <5.0.0) - huggingface_hub <2.0.0 -> <1.0.0 (transformers 4.x requires <1.0) - onnxruntime: add <1.28 upper bound for python > 3.10 (was unbounded) Verified none of the --all-extras packages require huggingface-hub >=1.0, so the <1.0.0 cap only declares the already-forced reality. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| include = ["conf/*",] | ||
|
|
||
| requires-python = ">=3.10,<3.15" | ||
| requires-python = ">=3.10,<3.14" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Fixes the analyzer
--all-extrasCI job hanging on "Resolving dependencies…" on every Python version (3.10–3.13), not just 3.14.Root cause: CI runs
poetry installwith no committed lock, so Poetry computes a universal resolve across the wholerequires-pythonrange. Widening it to<3.15(#2105) forced the solver to also satisfy Python 3.14, where the optional ML extras have no clean solution (e.g.onnxruntimeships cp314 wheels only for1.24.1–1.24.3;1.25+have none) → unbounded backtracking on every job. The runner's Python doesn't scope the resolve —requires-pythondoes — which is why 3.10/3.11 hang too.Fix:
presidio-analyzerrequires-pythonfrom<3.15back to>=3.10,<3.14.timeout-minutesas a safety net.3.14 can be re-added once the ML extras publish 3.14 wheels (tracked separately, cf. #2147).
Verified:
poetry lockforpresidio-analyzernow resolves in ~34s instead of hanging.Issue reference
N/A
Checklist