Skip to content

Unify override and exclude code - #20689

Merged
konstin merged 17 commits into
mainfrom
konsti/unify-dependency-modifiers
Sep 29, 2026
Merged

konstin merged 17 commits into
mainfrom
konsti/unify-dependency-modifiers

Conversation

@konstin

@konstin konstin commented Jul 25, 2026 •

Copy link
Copy Markdown
Member

We always apply overrides and excludes together, there's no need to always pass around two fields and apply both in sequence.

Being unified into one type, we can attach future dependency modifiers to that too.

@konstin konstin added the internal A refactor or improvement that is not user-facing label Jul 25, 2026
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 779ba35 to 2f55dcb Compare July 25, 2026 20:27
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 2f55dcb to 3644bd8 Compare July 25, 2026 20:39
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 3644bd8 to a46c026 Compare July 25, 2026 21:13
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from a46c026 to 49e77d7 Compare July 25, 2026 21:45
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 49e77d7 to fb2dfc1 Compare July 25, 2026 22:02
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from fb2dfc1 to 637e6aa Compare August 20, 2026 10:10
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from b27cea4 to f25dcc1 Compare September 8, 2026 13:13
@konstin konstin changed the title Unify override and exlude code Unify override and exclude code Sep 8, 2026
@astral-sh-bot

astral-sh-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

uv test inventory changes

This PR no longer changes the tests when compared with the main base revision.

@codspeed

codspeed Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 48 untouched benchmarks
⏩ 28 skipped benchmarks1


Comparing konsti/unify-dependency-modifiers (4fb61d3) with main (2274b80)

Open in CodSpeed

Footnotes

  1. 28 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Reuse the existing override and exclusion wire types, with generic requirement
mapping, while keeping the unified runtime collection and index.

Keep lock manifests sorted and deduplicated so an unchanged configuration with
repeated or unordered modifiers passes `uv lock --check --refresh`. Ignore
scoped overrides in constraint and exclusion scripts before validating them.
Cover both cases with integration tests.
Keep the public modifier methods and their private lookup index together so the implementation can be read in one place. Remove the child module and its extra visibility declarations.
Store overrides and exclusions together in their runtime scopes. Reconstruct
canonical entries for lockfiles and tool receipts, and compare modifiers
independently of input grouping, ordering, or duplication.

Keep distinct override origins for source annotations and retain independent
precedence for explicitly empty override and exclusion scopes.
Inline single-use insertion methods and expose temporary serialization
entries directly. Cover duplicate inputs and empty scopes in existing
integration tests instead of separate fixtures.
Lockfile normalization retains package names, so transform override values
in their existing scopes. Keep source annotations and empty scopes intact,
and use a single iterator when applying an override.
Look up modifiers directly from their input lists, keeping scoped precedence and source annotations intact. Sort and deduplicate only for lockfile comparison and serialization.
Append global overrides directly to the input list and keep scoped validation at construction. Retain the existing set-based lockfile serializer interface.
Group runtime dependency modifiers while retaining their global and package-scoped indexes. Keep configuration inputs, tool receipts, and lockfile formats unchanged.
Overrides and exclusions are applied through DependencyModifiers. Remove unused entry points and restrict the helpers to their remaining callers.

Restore the original pip compile fixtures and output snapshots.
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 6576e21 to 51ed22d Compare September 29, 2026 08:22
Record override and exclusion lookups through dependency modifiers, and keep normalized lockfile comparisons when validating a lock.
@konstin
konstin force-pushed the konsti/unify-dependency-modifiers branch from 51ed22d to 5cc6736 Compare September 29, 2026 09:49

@charliermarsh charliermarsh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable.

@konstin
konstin merged commit 7467a0d into main Sep 29, 2026
63 checks passed
@konstin
konstin deleted the konsti/unify-dependency-modifiers branch September 29, 2026 13:38

This branch was previously deployed

1 inactive deployment
automations — 4fb61d37 Deployed Sep 29, 2026 by konstin via review / security review #48074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants