Skip to content

chore(typing): extend Pyright checks to sample apps - #2791

Merged
vytas7 merged 3 commits into
falconry:masterfrom
Lbragaa:chore/2373-pyright-sample-apps
Nov 10, 2026
Merged

vytas7 merged 3 commits into
falconry:masterfrom
Lbragaa:chore/2373-pyright-sample-apps

Conversation

@Lbragaa

@Lbragaa Lbragaa commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

Extend the existing pyright_tests environment to check four sample applications. One Pyright command checks the three standalone examples together:

  • examples/quote.py
  • examples/things.py
  • examples/things_asgi.py

A separate command checks the WebSocket tutorial at examples/ws_tutorial/ws_tutorial/app.py. The environment installs Uvicorn because the tutorial imports it.

The examples exercise Falcon's public types in WSGI, ASGI, and WebSocket apps. This follows the sample-app approach suggested in #2379 and builds on #2650. The existing GitHub Actions job runs these checks as part of pyright_tests.

This is partial progress toward #2373. The change only affects development checks, so a news fragment is not needed.

Validation

On Windows with CPython 3.14.6:

  • All existing and new Pyright checks passed with zero errors or warnings.
  • All 10 default tox environments passed.
  • Main suite: 4,298 passed, 352 skipped.
  • Minimum-dependency suite: 3,996 passed, 571 skipped, 43 deselected.
  • Combined line and branch coverage: 100%.
  • A temporary invalid assignment to resp.status produced the expected Pyright error.

The local test suites used pytest 9.1.1 because pytest 9.2.0's output capture conflicts with an existing static-file test mock. One Uvicorn shutdown timed out during the first full run after the review edits. That test passed individually and on the full rerun.

AI Assistance

I used an AI coding assistant to help implement this change and run automated checks.

Related Issues

Refs #2373.

Pull Request Checklist

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
  • Performed automated tests and code quality checks by running tox.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst.
  • LLM output, if any, has been carefully reviewed and tested by a human developer.

@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c4af4f4) to head (b3a4188).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2791   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         8121      8121           
  Branches      1131      1131           
=========================================
  Hits          8121      8121           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vytas7 vytas7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @Lbragaa , and thanks for this PR.
The change itself looks good, but let's revert the CONTRIBUTING.md change, Pyright is not our primary way of checking things, so it would be grabbing too much attention in that already crowded file.

Also, let's condense the new command line not to use the list, maybe you could group it into two lines, following the previous precedent, one checking the three example files, and the other checking the WS tutorial?

@Lbragaa

Lbragaa commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @vytas7! I reverted the CONTRIBUTING.md changes and split the Pyright checks into two commands: one for the three standalone examples and one for the WebSocket tutorial. The Pyright checks and full tox run passed locally.

@vytas7 vytas7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @Lbragaa! LGTM.

@vytas7
vytas7 merged commit ff96e13 into falconry:master Nov 10, 2026
36 checks passed
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