[red-knot] Support custom typeshed Markdown tests (#15683)

## Summary

- Add feature to specify a custom typeshed from within Markdown-based
  tests
- Port "builtins" unit tests from `infer.rs` to Markdown tests, part of
  #13696

## Test Plan

- Tests for the custom typeshed feature
- New Markdown tests for deleted Rust unit tests
This commit is contained in:
David Peter 2025-01-23 12:36:38 +01:00 committed by GitHub
parent 84301a7300
commit 7855f03735
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 275 additions and 150 deletions

View file

@ -108,7 +108,7 @@ pub struct SearchPathSettings {
/// Optional path to a "custom typeshed" directory on disk for us to use for standard-library types.
/// If this is not provided, we will fallback to our vendored typeshed stubs for the stdlib,
/// bundled as a zip file in the binary
pub typeshed: Option<SystemPathBuf>,
pub custom_typeshed: Option<SystemPathBuf>,
/// The path to the user's `site-packages` directory, where third-party packages from ``PyPI`` are installed.
pub site_packages: SitePackages,
@ -119,7 +119,7 @@ impl SearchPathSettings {
Self {
src_roots,
extra_paths: vec![],
typeshed: None,
custom_typeshed: None,
site_packages: SitePackages::Known(vec![]),
}
}