You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Build coverage's C tracer from source in the Python 3.15 coverage shards - #6085
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
The configuration requests a source build of coverage for the targeted Python 3.15 environments. No actionable merge-blocking risk is identified; merge after normal checks pass.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and specifically describes the main change: building coverage's C tracer from source in the Python 3.15 coverage shards.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between 364a80197c96fae2473c10386ce384d9b74c2fe8 and ca4dafba10427221fa6633de797f73419de45704.
Files selected for processing: 1
tox.ini
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
⚠️52 benchmarks with a significant change ran on different hardware
Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
`--set-default-enum-member` writes each enum member of a default by the expression its type names the enum by then
(`annotations.Kind.book`). Importing the models of a hidden submodule from the submodule renamed the type to `Kind`
and dropped the module import, while the defaults kept naming `annotations`, the `__future__` feature, so the class
failed to define. The defaults now follow the new expression (`Kind.book`), through `name_enum_member`, as the other
import renames of the module do.
The new import of such a model kept off the names the module's resolver held, but not the names that the module's
other imports bind without it or that the shared imports bind: a model `Counter` beside `collections.Counter`, which
`x-python-type` or `--additional-imports` writes, took the name, and `Counter[str]` named the model. The import takes
another name now (`from .annotations import Counter as Counter_1`). A class of a package `__init__.py` hides its
submodule also where the `__init__.py` loads the submodule only for the class of an enum member literal.
The behaviour diff accepts the import paths that the fix removes from the importing modules of the new fixtures
(`from api import annotations`, the `__future__` feature, and `from pkg.api import Warn`, the package's class), whose
models failed to import or decode on 0.88.0 with every backend that resolves annotations late (#6009).
Under --use-enum-values-in-discriminator a variant spells the tag it inherits
by the Enum that types the tag property of its bases, as it spells a tag its
own Enum field holds: `Literal[FunctionType.function]`. The lookup of that
Enum read only the direct bases, so `NamedCall`, two levels below the
`FunctionBase` whose Enum types `type`, wrote `Literal['function']` while
`FunctionCall` wrote the member. It now reads the direct bases first and then
the ancestors above them, so both write the member, through the one lookup the
appended and the retyped tag fields and the check of the union share.
The same lookup ends a crash under --use-enum-values-in-discriminator
--reuse-model on a float Enum (`discriminator_enum_float_values.yaml`, a float
literal was built for a reused variant) and drops the internal marker that a
reused inline variant was tagged with (`discriminator_inline_variants.yaml`).
The #5338 test records the payload verdicts of each union: a plain Enum member
is no JSON string, so under the option the unions take the member from Python,
as they do for an own Enum field, and without it the JSON value.
A field that takes its alias after it is built keeps `alias=` below a generated base class, as that dataclass gives
the class its signature. L3 `delete_duplicate_models` drops a root model from the bases of the models that inherit
it, so a class whose only base was a root model was left without a base class and kept a non-identifier `alias=`,
which Pydantic before 2.4 rejects: `ValueError: 'x-y' is not a valid parameter name`.
`GenerationStore.set_base_classes` now writes the alias form again, through `DataModelFieldBase.alias_form`, for the
fields of a model it leaves without a base class, after the model is changed and the bases are final for it. The
declaration of `delete_duplicate_models` lists the aliases it writes that way.
Reasoning: I read the whole analysis context, diff and deleted-lines file. The read-boundary marker request was denied as expected. The only change to existing generated output is in the discriminator tag logic. _get_enum_from_base now searches every ancestor in method resolution order instead of only the direct bases. Under --use-enum-values-in-discriminator, the expected output for NamedCall changes from a string literal to a Literal of the FunctionType.function Enum member. The new payload file shows that the union now rejects JSON the schema accepts and accepts the Enum member from Python, so I flagged this as a code generation change for users of that option. One caveat: the old expected string literal value function may never have shipped. The behaviour diff shows the last release still wrote schema-name tags such as NamedCall by default, so this item may overlap the release note of the earlier tag fix. I found nothing else breaking. The default-option cells added in this PR are allowlist entries for crash fixes in how modules named annotations or named like a package class are imported. They replace imports that resolved to the future feature or a package class. Those import fixes also cover Enum defaults following the renamed import, the Counter_1 rename next to a shared import, and Enum member literal classes. The union-constraint decision now reads written_constraints, the constraints a field actually writes. It is limited to --field-constraints and to a constraint check that may be unreleased, and it leaves msgspec output unchanged. The alias change applies only to pydantic_v2.dataclass with --target-pydantic-version 2 when a model loses its only base. It writes serialization_alias plus validation_alias, which is a fix that keeps runtime behaviour equivalent. The new written_constraints property is an addition. Removed items are private helpers or type-hint, docs, test and tooling changes. No CLI options, Python version support or error handling changed.
Content for Release Notes
Code Generation Changes
Inherited discriminator tags use the Enum member under --use-enum-values-in-discriminator - Some variants of a discriminated union inherit their tag field from an ancestor two or more levels up, for example NamedCall below FunctionCall below a base whose type field is typed by the Enum FunctionType. The generator used to check only a variant's direct bases for the Enum. It now looks through all ancestors and takes the Enum from the nearest one that declares the field. Such a variant now gets type: Literal[FunctionType.function] instead of a plain string literal like Literal['function'], which matches how direct subclasses were already written. With a plain (non-str) Enum, the variant now accepts the Enum member passed from Python but rejects the raw JSON string "function". Code that builds or validates these variants with the raw string may need updating (Build coverage's C tracer from source in the Python 3.15 coverage shards #6085)
This analysis was produced by the release draft workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit