Skip to content

fix(ci): revert analyzer to Python <3.14 to fix Poetry resolve hang#2152

Open
RonShakutai wants to merge 3 commits into
mainfrom
ronshakutai/fix-ci-poetry-timeout
Open

fix(ci): revert analyzer to Python <3.14 to fix Poetry resolve hang#2152
RonShakutai wants to merge 3 commits into
mainfrom
ronshakutai/fix-ci-poetry-timeout

Conversation

@RonShakutai

@RonShakutai RonShakutai commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Change Description

Fixes the analyzer --all-extras CI job hanging 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 Python 3.14, where the 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. The runner's Python doesn't scope the resolve — requires-python does — which is why 3.10/3.11 hang too.

Fix:

  • Revert presidio-analyzer requires-python from <3.15 back to >=3.10,<3.14.
  • Drop the spacy 3.14 marker split (no longer needed).
  • Remove the Python 3.14 analyzer job from the CI test matrix.
  • Keep the previously added timeout-minutes as a safety net.

3.14 can be re-added once the ML extras publish 3.14 wheels (tracked separately, cf. #2147).

Verified: poetry lock for presidio-analyzer now resolves in ~34s instead of hanging.

Issue reference

N/A

Checklist

  • I have reviewed the contribution guidelines
  • I agree to follow this project's Code of Conduct
  • I confirm that I have the right to submit this contribution and that it does not knowingly contain proprietary or confidential code.
  • My code includes unit tests (CI/build change — no unit tests applicable)
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required (CHANGELOG)

- 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)
Copilot AI review requested due to automatic review settings July 9, 2026 17:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 matrix test job 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-interaction to poetry install to avoid CI waiting on prompts.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage report (presidio-anonymizer)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  presidio-anonymizer/presidio_anonymizer
  anonymizer_engine.py
  presidio-anonymizer/presidio_anonymizer/operators
  custom.py
Project Total  

This report was generated by python-coverage-comment-action

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage report (presidio-image-redactor)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  presidio-image-redactor/presidio_image_redactor
  dicom_image_pii_verify_engine.py
  document_intelligence_ocr.py
  image_analyzer_engine.py
Project Total  

This report was generated by python-coverage-comment-action

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage report (presidio-cli)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  presidio-cli/presidio_cli
  cli.py
Project Total  

This report was generated by python-coverage-comment-action

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Coverage report (presidio-structured)

This PR does not seem to contain any modification to coverable code.

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>
Copilot AI review requested due to automatic review settings July 9, 2026 18:22
@RonShakutai RonShakutai changed the title fix(ci): add timeout-minutes to prevent Poetry hanging fix(ci): revert analyzer to Python <3.14 to fix Poetry resolve hang Jul 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

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>
Copilot AI review requested due to automatic review settings July 9, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

include = ["conf/*",]

requires-python = ">=3.10,<3.15"
requires-python = ">=3.10,<3.14"
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.

2 participants