Skip to content

Check stdlib/venv with pyrefly - #16194

Merged
JelleZijlstra merged 4 commits into
python:mainfrom
srittau:pyrefly-venv
Aug 12, 2026
Merged

Check stdlib/venv with pyrefly#16194
JelleZijlstra merged 4 commits into
python:mainfrom
srittau:pyrefly-venv

Conversation

@srittau

@srittau srittau commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes the following warning when running the pyrefly checks:

WARN Skipping include pattern /home/runner/work/typeshed/typeshed/stdlib/venv/__init__.pyi because it is matched by project-excludes or an ignore file.

@srittau
srittau marked this pull request as draft August 12, 2026 12:52
@srittau

srittau commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

This didn't help. pyrefly still issues the warning. @yangdanny97 Do you have any idea how to best fix this?

@AlexWaygood

Copy link
Copy Markdown
Member

Codex says:


Add this to pyrefly.toml:

disable-project-excludes-heuristics = true

The existing project-excludes change does not work for two reasons:

  1. typeshed passes every stub as an explicit command-line argument, which puts Pyrefly into single-file mode, where project-excludes from configuration files is ignored.
  2. Pyrefly automatically appends its default exclusions, including **/venv/**, unless disable-project-excludes-heuristics is enabled.

Unlike project-excludes, disable-project-excludes-heuristics is respected in single-file mode when an explicit configuration file is provided. I tested this with typeshed’s pinned Pyrefly version, 1.3.0.dev1: without the setting, stdlib/venv/__init__.pyi produces the warning and is skipped; with it, the file is checked successfully with 0 errors.

Alternatively, add --disable-project-excludes-heuristics to the Pyrefly command in tests/pyrefly_test.py. The project-excludes addition in the current PR is unnecessary for the existing test invocation.

@srittau
srittau marked this pull request as ready for review August 12, 2026 14:02
@srittau

srittau commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

Warning is gone, thanks!

@JelleZijlstra
JelleZijlstra merged commit b73f5c1 into python:main Aug 12, 2026
64 checks passed
@srittau
srittau deleted the pyrefly-venv branch August 12, 2026 19:15
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.

3 participants