mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:38:25 +00:00
![]() ## Summary This PR does the following things: - Fixes the `python` configuration setting for mdtest (added in https://github.com/astral-sh/ruff/pull/17221) so that it expects a path pointing to a venv's `sys.prefix` variable rather than the a path pointing to the venv's `site-packages` subdirectory. This brings the `python` setting in mdtest in sync with our CLI `--python` flag. - Tweaks mdtest so that it automatically creates a valid `pyvenv.cfg` file for you if you don't specify one. This makes it much more ergonomic to write an mdtest with a custom `python` setting: red-knot will reject a `python` setting that points to a directory that doesn't have a `pyvenv.cfg` file in it - Tweaks mdtest so that it doesn't check a custom `pyvenv.cfg` as Python source code if you _do_ add a custom `pyvenv.cfg` file for your mock virtual environment in an mdtest. (You get a lot of diagnostics about Python syntax errors in the `pyvenv.cfg` file, otherwise!) - Rewrites the test added in https://github.com/astral-sh/ruff/pull/17178 as an mdtest, and deletes the original test that was added in that PR ## Test Plan I verified that the new mdtest fails if I revert the changes to `resolver.rs` that were added in https://github.com/astral-sh/ruff/pull/17178 |
||
---|---|---|
.. | ||
red_knot | ||
red_knot_ide | ||
red_knot_project | ||
red_knot_python_semantic | ||
red_knot_server | ||
red_knot_test | ||
red_knot_vendored | ||
red_knot_wasm | ||
ruff | ||
ruff_annotate_snippets | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_db | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_graph | ||
ruff_index | ||
ruff_linter | ||
ruff_macros | ||
ruff_notebook | ||
ruff_python_ast | ||
ruff_python_ast_integration_tests | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_python_trivia_integration_tests | ||
ruff_server | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm | ||
ruff_workspace |