Skip to content

Make AppHarness dependencies installable - #7008

Open
harsh21234i wants to merge 3 commits into
reflex-dev:mainfrom
harsh21234i:fix/6974-testing-deps
Open

Make AppHarness dependencies installable#7008
harsh21234i wants to merge 3 commits into
reflex-dev:mainfrom
harsh21234i:fix/6974-testing-deps

Conversation

@harsh21234i

@harsh21234i harsh21234i commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes issue #6974 by making reflex.testing usable from a clean published Reflex installation.

Changes

  • Removed the top-level uvicorn import from reflex.testing.

  • Added lazy imports with actionable installation messages.

  • Added a reflex[testing] extra containing:

    • uvicorn
    • psutil
    • selenium
  • Updated uv.lock.

  • Added a regression test for importing reflex.testing without test dependencies.

  • Added a changelog fragment.

Testing

  • AppHarness unit tests: 5 passed, 1 skipped
  • Verified reflex.testing imports without uvicorn and psutil.
  • Ruff formatting and lint checks passed.

Review in cubic

@harsh21234i
harsh21234i requested a review from a team as a code owner August 31, 2026 05:32
@greptile-apps

greptile-apps Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes reflex.testing importable without eagerly requiring AppHarness runtime dependencies.

  • Adds a testing package extra for psutil, Selenium, and uvicorn.
  • Lazily imports uvicorn at every backend and production frontend startup path, with actionable installation errors.
  • Adds equivalent missing-dependency guidance for psutil cleanup.
  • Adds an import regression test, lockfile update, and changelog fragment.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
reflex/testing.py Replaces the eager uvicorn import with guarded lazy imports across all runtime uses, resolving the previously reported production harness NameError.
pyproject.toml Adds the testing extra containing the three optional AppHarness dependencies.
tests/units/test_testing.py Adds regression coverage confirming that importing reflex.testing does not bind uvicorn at module load.
uv.lock Synchronizes the package lock metadata with the new testing extra.

Reviews (3): Last reviewed commit: "Merge branch 'main' into fix/6974-testin..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread reflex/testing.py
@codspeed-hq

codspeed-hq Bot commented Aug 31, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing harsh21234i:fix/6974-testing-deps (65263ee) with main (9a26753)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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