[red-knot] Do not ignore typeshed stubs for 'venv' module (#16596)

## Summary

We currently fail to add the stubs for the `venv` stdlib module because
there is a `venv/` ignore pattern in the top-level `.gitignore` file.

## Test Plan

Ran the typeshed sync workflow manually once to see if the `venv/`
folder is now correctly added.
This commit is contained in:
David Peter 2025-03-10 09:07:48 +01:00 committed by GitHub
parent b6c7ba4f8e
commit ca974706dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 111 additions and 0 deletions

4
crates/red_knot_vendored/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
# Do not ignore any of the vendored files. If this pattern is not present,
# we will gitignore the `venv/` stubs in typeshed, as there is a general
# rule to ignore `venv/` directories in the root `.gitignore`.
!/vendor/typeshed/**/*

View file

@ -0,0 +1,107 @@
import logging
import sys
from _typeshed import StrOrBytesPath
from collections.abc import Iterable, Sequence
from types import SimpleNamespace
logger: logging.Logger
if sys.version_info >= (3, 9):
CORE_VENV_DEPS: tuple[str, ...]
class EnvBuilder:
system_site_packages: bool
clear: bool
symlinks: bool
upgrade: bool
with_pip: bool
prompt: str | None
if sys.version_info >= (3, 13):
def __init__(
self,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
upgrade: bool = False,
with_pip: bool = False,
prompt: str | None = None,
upgrade_deps: bool = False,
*,
scm_ignore_files: Iterable[str] = ...,
) -> None: ...
elif sys.version_info >= (3, 9):
def __init__(
self,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
upgrade: bool = False,
with_pip: bool = False,
prompt: str | None = None,
upgrade_deps: bool = False,
) -> None: ...
else:
def __init__(
self,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
upgrade: bool = False,
with_pip: bool = False,
prompt: str | None = None,
) -> None: ...
def create(self, env_dir: StrOrBytesPath) -> None: ...
def clear_directory(self, path: StrOrBytesPath) -> None: ... # undocumented
def ensure_directories(self, env_dir: StrOrBytesPath) -> SimpleNamespace: ...
def create_configuration(self, context: SimpleNamespace) -> None: ...
def symlink_or_copy(
self, src: StrOrBytesPath, dst: StrOrBytesPath, relative_symlinks_ok: bool = False
) -> None: ... # undocumented
def setup_python(self, context: SimpleNamespace) -> None: ...
def _setup_pip(self, context: SimpleNamespace) -> None: ... # undocumented
def setup_scripts(self, context: SimpleNamespace) -> None: ...
def post_setup(self, context: SimpleNamespace) -> None: ...
def replace_variables(self, text: str, context: SimpleNamespace) -> str: ... # undocumented
def install_scripts(self, context: SimpleNamespace, path: str) -> None: ...
if sys.version_info >= (3, 9):
def upgrade_dependencies(self, context: SimpleNamespace) -> None: ...
if sys.version_info >= (3, 13):
def create_git_ignore_file(self, context: SimpleNamespace) -> None: ...
if sys.version_info >= (3, 13):
def create(
env_dir: StrOrBytesPath,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
with_pip: bool = False,
prompt: str | None = None,
upgrade_deps: bool = False,
*,
scm_ignore_files: Iterable[str] = ...,
) -> None: ...
elif sys.version_info >= (3, 9):
def create(
env_dir: StrOrBytesPath,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
with_pip: bool = False,
prompt: str | None = None,
upgrade_deps: bool = False,
) -> None: ...
else:
def create(
env_dir: StrOrBytesPath,
system_site_packages: bool = False,
clear: bool = False,
symlinks: bool = False,
with_pip: bool = False,
prompt: str | None = None,
) -> None: ...
def main(args: Sequence[str] | None = None) -> None: ...