Add textual to examples dependencies#791
Conversation
examples/quickstart_launcher.py imports textual but the package was not declared in any project dependency file, causing ModuleNotFoundError in the nightly examples CI test. Add textual>=1.0.0 to the dev dependency group in pyproject.toml (used by CI via 'uv sync --dev --all-extras') and to examples/requirements.txt (used for local development).
|
| Filename | Overview |
|---|---|
| examples/requirements.txt | Adds textual>=1.0.0 to align with the pyproject.toml dev dependency; straightforward addition. |
| pyproject.toml | Adds textual>=1.0.0 to the dev dependency group to fix the CI ModuleNotFoundError. |
| uv.lock | Lockfile updated to include textual 8.2.4 and its transitive deps; notably bumps rich from 14.1.0 to 15.0.0. |
Prompt To Fix All With AI
This is a comment left during a code review.
Path: uv.lock
Line: 7529-7544
Comment:
**Transitive `rich` major version bump**
Adding `textual>=1.0.0` (resolved to `8.2.4`) causes `rich` to be bumped from `14.1.0` to `15.0.0` as a transitive dependency. If `rich` is used elsewhere in the project (including non-dev code), this major version bump could introduce subtle breaking changes. Worth verifying that the existing codebase is compatible with `rich` 15.x before merging.
How can I resolve this? If you propose a fix, please make it concise.Reviews (2): Last reviewed commit: "fix: add version constraint to textual i..." | Re-trigger Greptile
| "pytest-xdist[psutil]>=3.8.0", | ||
| "sphinx>=8.2.3", | ||
| "sphinx-mintlify>=0.1.0", | ||
| "textual>=1.0.0", |
There was a problem hiding this comment.
No tests added for this bug fix
This PR fixes a CI failure caused by a missing dependency declaration. Per the project's test guidelines, at least one integration test should accompany bug fix PRs. Consider adding a test that verifies textual is importable (e.g., extending the existing test_root_level_scripts suite or adding a smoke-import check for quickstart_launcher.py).
Context Used: # Test guidelines
- Add a comment if the PR does n... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: pyproject.toml
Line: 74
Comment:
**No tests added for this bug fix**
This PR fixes a CI failure caused by a missing dependency declaration. Per the project's test guidelines, at least one integration test should accompany bug fix PRs. Consider adding a test that verifies `textual` is importable (e.g., extending the existing `test_root_level_scripts` suite or adding a smoke-import check for `quickstart_launcher.py`).
**Context Used:** # Test guidelines
- Add a comment if the PR does n... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
The existing test_root_level_scripts in tests/examples/test_examples.py already parametrizes over all .py files in the examples/ directory — including quickstart_launcher.py. That test is exactly what caught this missing dependency in the nightly run. Adding a separate smoke-import test would be redundant since the existing test already validates that the script (and its imports) work end-to-end.
Align with pyproject.toml by pinning textual>=1.0.0 instead of leaving it unpinned.
Summary
textual>=1.0.0to thedevdependency group inpyproject.tomlso it is installed in CI viauv sync --dev --all-extrastextualtoexamples/requirements.txtfor local development convenienceProblem
examples/quickstart_launcher.pyimports fromtextual.app,textual.containers,textual.css.query, andtextual.widgets, buttextualwas never declared as a dependency. This causestest_root_level_scripts[quickstart_launcher.py]to fail withModuleNotFoundError: No module named 'textual'in the nightly examples CI.Related Insight
https://app.mendral.com/insights/01KQ6VZ59DC7CVN7W3NW6A5Y09
Note
Created by Mendral. Tag @mendral-app with feedback or questions.