Summary
--
This is a first step toward adding mdtests for Ruff. I actually wrote
the code
in the opposite order, first copy-pasting `ty_test` to a `ruff_test`
crate, and then
factoring out the shared code, but I figured it would be easier to
review in
this order. I also opened a stacked PR with the `ruff_test` changes
(#24617)
to show that the API works well for that too.
The main change here is moving several of the modules from `ty_test` to
a new
`mdtest` crate:
- `assertion`
- `diagnostic`
- `matcher`
- `parser`
Beyond moving these files to the new crate, I made `Matcher` functions
take a
`&dyn Db` to support passing a different concrete type from `ruff_test`,
and I
also made the parser generic over an `MdtestConfig` trait to allow Ruff
to use a
separate config struct. I also introduced new `TestConfig` and `TestDb`
types to allow
testing the `matcher` and `parser` within the `mdtest` crate without
depending
on either the real ty `Db` or `ty_test` config type.
The lib.rs file from `ty_test` was essentially split in half, with the
shared
code moved to the `mdtest` crate and the ty-specific parts kept in
`ty_test`.
Test Plan
--
All existing mdtests and the unit tests from `ty_test` should still
pass, and
the stacked branch with the `ruff_test` crate tests the split API
## Summary
This is in preparation for https://github.com/astral-sh/ruff/pull/24097
I want to integrate fixes into mdtests, but `ty_test` doesn't depend on
`ty_project`, and adding this new dependency would create more cyclic
dependencies between crates (not targets, just crates), which r-a
sometimes struggles with.
The solution in this PR is to move `fixes` to `ty_python_semantic`. This
is mostly a trivial change, except that it requires adding a
`check_file` method to `db.`
## Test Plan
`cargo test`
## Summary
This unifies the validation of supported Python versions between the CLI
and TOML (e.g., `environment.python-version`) by introducing a single
enum to share across them.
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [arc-swap](https://redirect.github.com/vorner/arc-swap) |
workspace.dependencies | minor | `1.8.2` → `1.9.0` |
---
### Release Notes
<details>
<summary>vorner/arc-swap (arc-swap)</summary>
###
[`v1.9.0`](https://redirect.github.com/vorner/arc-swap/blob/HEAD/CHANGELOG.md#190)
[Compare
Source](https://redirect.github.com/vorner/arc-swap/compare/v1.8.2...v1.9.0)
- Promote certain orderings to SeqCst. Original proofs based on wrong
reading of
standard :-(. Expect some performance degradation
([#​198](https://redirect.github.com/vorner/arc-swap/issues/198),
[#​200](https://redirect.github.com/vorner/arc-swap/issues/200)).
</details>
---
### Configuration
📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My45NC4xIiwidXBkYXRlZEluVmVyIjoiNDMuOTQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>