Skip to content

Wire exclude-newer policy into libmambapy Database#905

Draft
jezdez wants to merge 2 commits into
conda:mainfrom
jezdez:feature/exclude-newer
Draft

Wire exclude-newer policy into libmambapy Database#905
jezdez wants to merge 2 commits into
conda:mainfrom
jezdez:feature/exclude-newer

Conversation

@jezdez

@jezdez jezdez commented Apr 10, 2026

Copy link
Copy Markdown
Member

Description

Updates the libmamba solver backend for conda/conda#15761's conda-owned ExcludeNewerPolicy.

This PR now consumes the resolved policy from conda instead of reparsing raw context.exclude_newer in the solver plugin. That keeps duration/date parsing, date-only semantics, zero-duration behavior, and command-time now resolution centralized in conda.

Changes

  • Declare supports_exclude_newer_global = True on LibMambaSolver.
  • Leave package overrides unsupported, so conda continues to fail closed for active exclude_newer_package policies.
  • Pass self.exclude_newer_policy into LibMambaIndexHelper.
  • Convert the resolved global cutoff to libmambapy's exclude_newer_timestamp only when a global cutoff is active.
  • Temporarily test against jezdez/conda@feature/repodata-filter-cooldown until Add first-party --exclude-newer policy conda#15761 lands.
  • Add focused tests for resolved cutoff conversion and solver capability flags.

Limitations

This remains draft work because native libmamba support is still needed. It depends on mamba-org/mamba#4228 adding exclude_newer_timestamp to Database::Settings / libmambapy.

This PR supports the global cutoff only. Per-package overrides require upstream libmamba/libmambapy support for package-specific cutoffs before this solver can set supports_exclude_newer_package = True.

Part of conda/conda#15759.

Validation

  • uv run --no-project --with ruff ruff check conda_libmamba_solver/index.py conda_libmamba_solver/solver.py tests/test_index.py tests/test_solver.py
  • uv run --no-project --with ruff ruff format --check conda_libmamba_solver/index.py conda_libmamba_solver/solver.py tests/test_index.py tests/test_solver.py
  • PYTHONPATH=/Users/jezdez/Code/git/conda:. /Users/jezdez/miniforge3/envs/cls-dev/bin/python -m pytest -o addopts='' tests/test_index.py::test_exclude_newer_timestamp_unset tests/test_index.py::test_exclude_newer_timestamp_uses_resolved_global_cutoff tests/test_solver.py::test_solver_declares_global_exclude_newer_support_only -q
  • PYTHONPATH=/Users/jezdez/Code/git/conda:. /Users/jezdez/miniforge3/envs/cls-dev/bin/python -m compileall -q conda_libmamba_solver/index.py conda_libmamba_solver/solver.py tests/test_index.py tests/test_solver.py
  • git diff --check

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Apr 10, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Apr 10, 2026
@jezdez jezdez force-pushed the feature/exclude-newer branch 3 times, most recently from c83f07b to 19d6814 Compare April 10, 2026 13:11
@jezdez jezdez force-pushed the feature/exclude-newer branch from 4ea1409 to 266b91f Compare June 8, 2026 11:11
@jezdez jezdez changed the title Pass context.exclude_newer to libmambapy Database Wire exclude-newer policy into libmambapy Database Jun 8, 2026
@jezdez jezdez force-pushed the feature/exclude-newer branch from 266b91f to da4c7c4 Compare June 8, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

2 participants