Skip to content

feat: expose PackageCache in py-rattler#2207

Draft
DCchoudhury15 wants to merge 2 commits intoconda:mainfrom
DCchoudhury15:feat/expose-package-cache-v2
Draft

feat: expose PackageCache in py-rattler#2207
DCchoudhury15 wants to merge 2 commits intoconda:mainfrom
DCchoudhury15:feat/expose-package-cache-v2

Conversation

@DCchoudhury15
Copy link
Contributor

@DCchoudhury15 DCchoudhury15 commented Mar 11, 2026

Description

PR #1003 added a layered package cache to the Rust core but it was never exposed to Python. This PR adds the Python bindings for PackageCache and ValidationMode.

Users can now do:

from rattler import PackageCache, ValidationMode
from pathlib import Path

cache = PackageCache(Path("/tmp/cache"))

# or with multiple layers
cache = PackageCache.new_layered(
    [Path("/slow/cache"), Path("/fast/cache")],
    validation_mode=ValidationMode.Fast,
)

cache.paths()
cache.writable_paths()
cache.readonly_paths()

Fixes #632

How Has This Been Tested?

Added 12 unit tests in py-rattler/tests/unit/test_package_cache.py.

cd py-rattler && pytest tests/unit/test_package_cache.py -v

AI Disclosure

  • This PR contains AI-generated content.(testfile has been written with the help of ai)
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added sufficient tests to cover my changes.

@DCchoudhury15 DCchoudhury15 force-pushed the feat/expose-package-cache-v2 branch from d27eedf to 3ba2d3f Compare March 11, 2026 13:41
@DCchoudhury15 DCchoudhury15 force-pushed the feat/expose-package-cache-v2 branch from 3e8e8ce to f200ff7 Compare March 11, 2026 14:24
@DCchoudhury15 DCchoudhury15 force-pushed the feat/expose-package-cache-v2 branch from bcc0863 to 681e13e Compare March 11, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose PackageCache in py-rattler

1 participant