diskcache-rs 0.4.9__tar.gz → 0.4.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/actions/setup-diskcache-rs/action.yml +1 -1
  2. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/workflows/benchmark.yml +24 -26
  3. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/workflows/build-abi3.yml +1 -1
  4. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/workflows/build.yml +17 -4
  5. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/workflows/release.yml +12 -7
  6. diskcache_rs-0.4.12/.release-please-manifest.json +3 -0
  7. diskcache_rs-0.4.12/AGENTS.md +90 -0
  8. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/CHANGELOG.md +38 -0
  9. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/Cargo.lock +47 -39
  10. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/Cargo.toml +5 -5
  11. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/PKG-INFO +1 -1
  12. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/performance_comparison.py +34 -0
  13. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/__init__.py +2 -5
  14. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/__init__.pyi +49 -17
  15. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/cache.py +19 -6
  16. diskcache_rs-0.4.12/python/diskcache_rs/djangocache.py +118 -0
  17. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/cache.rs +7 -9
  18. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/eviction.rs +119 -8
  19. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/memory_cache.rs +1 -0
  20. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/migration.rs +1 -1
  21. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/storage/optimized_backend.rs +392 -505
  22. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/conftest.py +9 -3
  23. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_batch_operations.py +2 -2
  24. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_ci_benchmark.py +3 -1
  25. diskcache_rs-0.4.12/tests/test_issue_125_djangocache_multiprocess.py +194 -0
  26. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_issue_17_configurable_threshold.py +19 -18
  27. diskcache_rs-0.4.12/tests/test_issue_345_nfs_safe_sqlite.py +58 -0
  28. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_performance.py +6 -2
  29. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_special_chars_keys.py +10 -0
  30. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_version_and_disk_threshold.py +18 -18
  31. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/uv.lock +44 -19
  32. diskcache_rs-0.4.9/.release-please-manifest.json +0 -3
  33. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  34. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  35. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/actions/build-and-test/action.yml +0 -0
  36. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/pull_request_template.md +0 -0
  37. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.github/workflows/ci.yml +0 -0
  38. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.gitignore +0 -0
  39. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/.pre-commit-config.yaml +0 -0
  40. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/API_COMPATIBILITY.md +0 -0
  41. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/Dockerfile.test +0 -0
  42. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/LICENSE +0 -0
  43. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/README.md +0 -0
  44. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/batch_write_comparison.py +0 -0
  45. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/comprehensive_performance_test.py +0 -0
  46. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/detailed_profiling.py +0 -0
  47. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/final_performance_comparison.py +0 -0
  48. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/high_performance_test.py +0 -0
  49. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/memory_usage_test.py +0 -0
  50. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/micro_benchmark.py +0 -0
  51. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/optimization_validation_test.py +0 -0
  52. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/pickle_bridge_comparison.py +0 -0
  53. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/precise_benchmark.py +0 -0
  54. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/benchmarks/set_performance_analysis.py +0 -0
  55. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/docker-compose.test.yml +0 -0
  56. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/examples/basic_usage.py +0 -0
  57. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/examples/special_chars_keys_example.py +0 -0
  58. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/justfile +0 -0
  59. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/pyproject.toml +0 -0
  60. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/_diskcache_rs.pyi +0 -0
  61. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/constants.py +0 -0
  62. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/core.py +0 -0
  63. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/disk.py +0 -0
  64. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/fast_cache.py +0 -0
  65. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/pickle_cache.py +0 -0
  66. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/recipes.py +0 -0
  67. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/python/diskcache_rs/rust_pickle.py +0 -0
  68. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/release-please-config.json +0 -0
  69. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/renovate.json +0 -0
  70. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/scripts/generate_stubs.py +0 -0
  71. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/scripts/sync_version.py +0 -0
  72. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/scripts/test-docker-network.sh +0 -0
  73. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/error.rs +0 -0
  74. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/lib.rs +0 -0
  75. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/pickle_cache.rs +0 -0
  76. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/serialization.rs +0 -0
  77. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/storage/tests.rs +0 -0
  78. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/storage.rs +0 -0
  79. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/src/utils.rs +0 -0
  80. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/__init__.py +0 -0
  81. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/benchmark_official.py +0 -0
  82. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_api_compatibility.py +0 -0
  83. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_basic_operations.py +0 -0
  84. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_compatibility.py +0 -0
  85. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_complete_api_gaps.py +0 -0
  86. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_cross_platform_network.py +0 -0
  87. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_diskcache_rs_persistence_suite.py +0 -0
  88. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_docker_network.py +0 -0
  89. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_fast_cache.py +0 -0
  90. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_full_api_compatibility.py +0 -0
  91. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_issue_73_deterministic_hashing.py +0 -0
  92. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_issue_78_expire_method.py +0 -0
  93. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_network_filesystem.py +0 -0
  94. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_pickle_cache.py +0 -0
  95. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_recipes_and_constants.py +0 -0
  96. {diskcache_rs-0.4.9 → diskcache_rs-0.4.12}/tests/test_rust_pickle_performance.py +0 -0
@@ -18,7 +18,7 @@ runs:
18
18
  using: 'composite'
19
19
  steps:
20
20
  - name: Install uv
21
- uses: astral-sh/setup-uv@v7
21
+ uses: astral-sh/setup-uv@v8.2.0
22
22
  with:
23
23
  python-version: ${{ inputs.python-version }}
24
24
 
@@ -33,7 +33,7 @@ jobs:
33
33
  uses: dtolnay/rust-toolchain@stable
34
34
 
35
35
  - name: Install uv
36
- uses: astral-sh/setup-uv@v7
36
+ uses: astral-sh/setup-uv@v8.2.0
37
37
 
38
38
  - name: Install dependencies
39
39
  run: |
@@ -63,7 +63,7 @@ jobs:
63
63
 
64
64
  - name: Comment PR with benchmark results
65
65
  if: github.event_name == 'pull_request'
66
- uses: actions/github-script@v8
66
+ uses: actions/github-script@v9
67
67
  with:
68
68
  script: |
69
69
  const fs = require('fs');
@@ -72,33 +72,31 @@ jobs:
72
72
  const results = JSON.parse(fs.readFileSync('benchmark_results.json', 'utf8'));
73
73
 
74
74
  let comment = '## 📊 Performance Benchmark Results\n\n';
75
- comment += '| Benchmark | python-diskcache | diskcache_rs | Winner |\n';
76
- comment += '|-----------|------------------|--------------|--------|\n';
75
+ comment += '| Benchmark | Metric | python-diskcache | diskcache_rs | Winner |\n';
76
+ comment += '|-----------|--------|------------------|--------------|--------|\n';
77
77
 
78
- for (const [name, result] of Object.entries(results)) {
79
- // Handle both old and new result formats
80
- let dcOps, rsOps;
81
- if (result.diskcache && result.diskcache_rs) {
82
- // New format with nested operations
83
- if (result.diskcache.get && result.diskcache_rs.get) {
84
- dcOps = result.diskcache.get.ops_per_sec;
85
- rsOps = result.diskcache_rs.get.ops_per_sec;
86
- } else {
87
- dcOps = result.diskcache.ops_per_sec || 0;
88
- rsOps = result.diskcache_rs.ops_per_sec || 0;
89
- }
90
- } else {
91
- continue; // Skip malformed results
92
- }
78
+ const addRow = (name, metric, dcOps, rsOps) => {
79
+ if (!dcOps || !rsOps) return;
80
+ const winner = dcOps > rsOps
81
+ ? `python-diskcache (${(dcOps/rsOps).toFixed(1)}x)`
82
+ : `diskcache_rs (${(rsOps/dcOps).toFixed(1)}x)`;
83
+ comment += `| ${name} | ${metric} | ${dcOps.toFixed(1)} ops/s | ${rsOps.toFixed(1)} ops/s | ${winner} |\n`;
84
+ };
93
85
 
94
- let winner;
95
- if (dcOps > rsOps) {
96
- winner = `python-diskcache (${(dcOps/rsOps).toFixed(1)}x)`;
97
- } else {
98
- winner = `diskcache_rs (${(rsOps/dcOps).toFixed(1)}x)`;
86
+ for (const [name, result] of Object.entries(results)) {
87
+ if (!result.diskcache || !result.diskcache_rs) continue;
88
+
89
+ const weighted = result.weighted_ops_per_sec || {};
90
+ addRow(name, 'weighted', weighted.diskcache, weighted.diskcache_rs);
91
+
92
+ for (const metric of ['get', 'set', 'delete']) {
93
+ addRow(
94
+ name,
95
+ metric,
96
+ result.diskcache[metric]?.ops_per_sec,
97
+ result.diskcache_rs[metric]?.ops_per_sec
98
+ );
99
99
  }
100
-
101
- comment += `| ${name} | ${dcOps.toFixed(1)} ops/s | ${rsOps.toFixed(1)} ops/s | ${winner} |\n`;
102
100
  }
103
101
 
104
102
  comment += '\n> 💡 **Note**: Performance varies based on storage type and network conditions.\n';
@@ -17,7 +17,7 @@ jobs:
17
17
  runs-on: ubuntu-latest
18
18
  strategy:
19
19
  matrix:
20
- target: [x86_64, i686]
20
+ target: [x86_64]
21
21
  steps:
22
22
  - uses: actions/checkout@v6
23
23
  - uses: actions/setup-python@v6
@@ -20,7 +20,7 @@ jobs:
20
20
  runs-on: ubuntu-latest
21
21
  strategy:
22
22
  matrix:
23
- target: [x86_64, i686]
23
+ target: [x86_64]
24
24
  steps:
25
25
  - uses: actions/checkout@v6
26
26
  - uses: actions/setup-python@v6
@@ -63,7 +63,14 @@ jobs:
63
63
  args: --release --out dist --find-interpreter
64
64
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
65
65
  manylinux: auto
66
- - uses: uraimo/run-on-arch-action@v3.0.1
66
+ - name: Pre-pull binfmt image
67
+ run: |
68
+ for attempt in 1 2 3; do
69
+ docker pull tonistiigi/binfmt:latest && break
70
+ if [ "$attempt" = "3" ]; then exit 1; fi
71
+ sleep $((attempt * 5))
72
+ done
73
+ - uses: uraimo/run-on-arch-action@v3.1.0
67
74
  if: matrix.target != 'ppc64le'
68
75
  name: Install built wheel
69
76
  with:
@@ -91,7 +98,6 @@ jobs:
91
98
  matrix:
92
99
  target:
93
100
  - x86_64-unknown-linux-musl
94
- - i686-unknown-linux-musl
95
101
  steps:
96
102
  - uses: actions/checkout@v6
97
103
  - uses: actions/setup-python@v6
@@ -152,7 +158,14 @@ jobs:
152
158
  args: --release --out dist --find-interpreter
153
159
  sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
154
160
  manylinux: musllinux_1_2
155
- - uses: uraimo/run-on-arch-action@v3.0.1
161
+ - name: Pre-pull binfmt image
162
+ run: |
163
+ for attempt in 1 2 3; do
164
+ docker pull tonistiigi/binfmt:latest && break
165
+ if [ "$attempt" = "3" ]; then exit 1; fi
166
+ sleep $((attempt * 5))
167
+ done
168
+ - uses: uraimo/run-on-arch-action@v3.1.0
156
169
  name: Install built wheel
157
170
  with:
158
171
  arch: ${{ matrix.platform.arch }}
@@ -11,6 +11,11 @@ on:
11
11
  - 'v*'
12
12
  - 'diskcache_rs-v*' # Support release-please tag format
13
13
  workflow_dispatch:
14
+ inputs:
15
+ tag_name:
16
+ description: Existing release tag to rebuild and republish
17
+ required: false
18
+ type: string
14
19
 
15
20
  permissions:
16
21
  contents: write # Required for creating releases and uploading artifacts
@@ -28,7 +33,7 @@ jobs:
28
33
  tag_name: ${{ steps.release.outputs.tag_name }}
29
34
  releases_created: ${{ steps.release.outputs.releases_created }}
30
35
  steps:
31
- - uses: googleapis/release-please-action@v4
36
+ - uses: googleapis/release-please-action@v5
32
37
  id: release
33
38
  with:
34
39
  token: ${{ secrets.GITHUB_TOKEN }}
@@ -37,7 +42,7 @@ jobs:
37
42
  # Call the build workflow to build standard wheels (only if release was created)
38
43
  build:
39
44
  needs: release-please
40
- if: ${{ needs.release-please.outputs.release_created }}
45
+ if: ${{ needs.release-please.outputs.release_created || (github.event_name == 'workflow_dispatch' && inputs.tag_name != '') }}
41
46
  uses: ./.github/workflows/build.yml
42
47
  permissions:
43
48
  contents: read
@@ -47,7 +52,7 @@ jobs:
47
52
  # Call the ABI3 build workflow to build universal wheels (only if release was created)
48
53
  build-abi3:
49
54
  needs: release-please
50
- if: ${{ needs.release-please.outputs.release_created }}
55
+ if: ${{ needs.release-please.outputs.release_created || (github.event_name == 'workflow_dispatch' && inputs.tag_name != '') }}
51
56
  uses: ./.github/workflows/build-abi3.yml
52
57
  permissions:
53
58
  contents: read
@@ -57,7 +62,7 @@ jobs:
57
62
  # Call the CI workflow to run tests (only if release was created)
58
63
  test:
59
64
  needs: release-please
60
- if: ${{ needs.release-please.outputs.release_created }}
65
+ if: ${{ needs.release-please.outputs.release_created || (github.event_name == 'workflow_dispatch' && inputs.tag_name != '') }}
61
66
  uses: ./.github/workflows/ci.yml
62
67
  permissions:
63
68
  contents: read
@@ -108,7 +113,7 @@ jobs:
108
113
  name: Create GitHub Release
109
114
  runs-on: ubuntu-latest
110
115
  needs: [release-please, pypi-publish]
111
- if: ${{ needs.release-please.outputs.release_created }}
116
+ if: ${{ needs.release-please.outputs.release_created || (github.event_name == 'workflow_dispatch' && inputs.tag_name != '') }}
112
117
  permissions:
113
118
  contents: write # Required for creating releases
114
119
  actions: read # Required for downloading artifacts
@@ -153,8 +158,8 @@ jobs:
153
158
  with:
154
159
  artifacts: "release-artifacts/*"
155
160
  token: ${{ secrets.GITHUB_TOKEN }}
156
- tag: ${{ needs.release-please.outputs.tag_name }}
157
- name: ${{ needs.release-please.outputs.tag_name }}
161
+ tag: ${{ inputs.tag_name || needs.release-please.outputs.tag_name }}
162
+ name: ${{ inputs.tag_name || needs.release-please.outputs.tag_name }}
158
163
  body: |
159
164
  Comparing Changes: ${{ steps.changelog.outputs.compareurl }}
160
165
 
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.12"
3
+ }
@@ -0,0 +1,90 @@
1
+ # AGENTS.md — diskcache_rs
2
+
3
+ > High-performance disk cache implemented in Rust with PyO3 Python bindings,
4
+ > built and shipped with maturin as the `diskcache_rs` PyPI package — a
5
+ > drop-in, faster alternative to the pure-Python `diskcache`.
6
+ > Navigation map for AI agents, not a reference manual. Follow the links; do
7
+ > not read everything up front.
8
+
9
+ ## Build & test
10
+
11
+ This repo has a justfile — use it. Run `just --list` for the live recipe list.
12
+
13
+ ```bash
14
+ vx just dev # install + build + stubs: full dev environment setup
15
+ vx just build # uvx maturin develop (debug extension module)
16
+ vx just build-release # uvx maturin develop --release
17
+ vx just test # uv run python -m pytest tests/ -v
18
+ vx just test-cov # pytest with HTML coverage for diskcache_rs
19
+ vx just check # format + lint + test (the local CI equivalent)
20
+ vx just lint # cargo clippy -- -D warnings, then uv run ruff check .
21
+ vx just format # cargo fmt --all, then uv run ruff format .
22
+ vx just fix # clippy --fix + ruff check --fix
23
+ ```
24
+
25
+ Release-oriented recipes:
26
+
27
+ ```bash
28
+ vx just release # uvx maturin build --release
29
+ vx just release-abi3 # uvx maturin build --release --features abi3 (Python 3.8+)
30
+ vx just publish # release, then uvx maturin publish (needs PyPI auth)
31
+ vx just sync-version # scripts/sync_version.py: Cargo.toml <-> pyproject.toml
32
+ vx just stubs # regenerate .pyi stubs with pyo3-stubgen
33
+ vx just verify-stubs # confirm .pyi files land inside the built wheel
34
+ vx just bench # pytest -k benchmark
35
+ vx just bench-pickle # benchmarks/pickle_bridge_comparison.py
36
+ vx just audit # cargo audit
37
+ ```
38
+
39
+ Requires Rust 1.87+, Python 3.8+, and `uv` / `maturin`.
40
+
41
+ ## Repo layout
42
+
43
+ | Path | Role |
44
+ |---|---|
45
+ | `src/cache.rs` | Core cache implementation and the PyO3 class surface |
46
+ | `src/storage.rs`, `src/storage/optimized_backend.rs` | SQLite-backed persistent storage (`rusqlite`, bundled) |
47
+ | `src/memory_cache.rs`, `src/eviction.rs` | In-memory tier and eviction policy |
48
+ | `src/serialization.rs` | Serializers: `serde_json`, `bincode`, `rmp-serde`, `postcard`, `lz4_flex` |
49
+ | `src/pickle_cache.rs` | Pickle-compatible values via the Rust pickle bridge |
50
+ | `src/migration.rs` | Import/migration path from the pure-Python `diskcache` |
51
+ | `src/error.rs`, `src/utils.rs` | Error types and helpers (`blake3`, `dashmap`, `parking_lot`) |
52
+ | `python/diskcache_rs/` | Python package wrapper: `cache.py`, `core.py`, `disk.py`, `fast_cache.py`, `pickle_cache.py`, `djangocache.py`, `recipes.py`, `constants.py`, plus `.pyi` stubs |
53
+ | `tests/` | Pytest suite — API-compatibility, persistence, network filesystem, NFS-safe SQLite, Django cache, performance |
54
+ | `benchmarks/` | Standalone performance and profiling scripts (not part of `just test`) |
55
+ | `examples/` | `basic_usage.py`, `special_chars_keys_example.py` |
56
+ | `scripts/` | `sync_version.py`, `generate_stubs.py`, `test-docker-network.sh` |
57
+ | `API_COMPATIBILITY.md` | Behavioural delta against upstream `diskcache` — read before changing public API |
58
+ | `Dockerfile.test`, `docker-compose.test.yml` | Containerised network-filesystem tests |
59
+
60
+ ## Release
61
+
62
+ - release-please drives versioning from Conventional Commits on `main`
63
+ (`release-please-config.json`). `.release-please-manifest.json` is the single
64
+ source of version truth.
65
+ - `feat:` → minor, `fix:` → patch, `chore:`/`docs:`/`ci:` → **no release**.
66
+ - Use `chore:`/`docs:` for config and doc work so release-please does not cut a
67
+ valueless version.
68
+ - Merging the release PR triggers `.github/workflows/release.yml`, which calls
69
+ `build.yml` and `build-abi3.yml` to produce both wheel flavours, then
70
+ publishes to PyPI and creates the GitHub release.
71
+ - `Cargo.toml` and `pyproject.toml` must carry the same version —
72
+ `just sync-version` is the supported way to reconcile them.
73
+
74
+ ## Do / Don't
75
+
76
+ - **Do** keep the two wheels working: any new PyO3 surface must build under
77
+ both the default and the `abi3` (`abi3-py38`) feature.
78
+ - **Do** regenerate stubs (`just stubs`) and confirm them in the wheel
79
+ (`just verify-stubs`) after changing the Rust API.
80
+ - **Do** check `API_COMPATIBILITY.md` before changing anything the pure-Python
81
+ `diskcache` also exposes.
82
+ - **Don't** edit `python/diskcache_rs/*.pyi` by hand — they are generated.
83
+ - **Don't** hardcode an exact version in tests (`assert __version__ == "X.Y.Z"`)
84
+ — release-please bumps will break it. Use `>=` or read package metadata.
85
+ `tests/test_version_and_disk_threshold.py` already depends on this.
86
+ - **Don't** add `CLAUDE.md` / `GEMINI.md` / `CURSOR.md` / `ANTHROPIC.md` /
87
+ `OPENAI.md` / `COPILOT.md` / `CODEBUDDY.md` / `.cursorrules` / `.clinerules` /
88
+ `.windsurfrules` at the root. This file is the only agent contract file.
89
+ - **Don't** commit build artifacts to the repo root (`target/`, `dist/`,
90
+ `htmlcov/`, `coverage.json`, `*.so`, `*.pyd`).
@@ -4,6 +4,44 @@
4
4
 
5
5
  - sync Cargo.toml version with .cz.toml and update CHANGELOG for v0.4.0
6
6
 
7
+ ## [0.4.12](https://github.com/loonghao/diskcache_rs/compare/diskcache_rs-v0.4.11...diskcache_rs-v0.4.12) (2026-10-14)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * clear frequency-0 bucket in LfuEviction::on_access ([#149](https://github.com/loonghao/diskcache_rs/issues/149)) ([9cd0c23](https://github.com/loonghao/diskcache_rs/commit/9cd0c236543970a707912114bdbd2a8c743db0b0))
13
+ * **deps:** update rust crate pyo3 to 0.29 ([2e355aa](https://github.com/loonghao/diskcache_rs/commit/2e355aabf3b78b83db404335d75babef4e56e689))
14
+ * **deps:** update rust crate rusqlite to 0.40 ([44b3a65](https://github.com/loonghao/diskcache_rs/commit/44b3a6531a41266101abef4eda4d77671339fa42))
15
+
16
+
17
+ ### Documentation
18
+
19
+ * add AGENTS.md agent contract ([#146](https://github.com/loonghao/diskcache_rs/issues/146)) ([d6d10bb](https://github.com/loonghao/diskcache_rs/commit/d6d10bb39707f599c722b3302eec7b9da35b905e))
20
+
21
+ ## [0.4.11](https://github.com/loonghao/diskcache_rs/compare/diskcache_rs-v0.4.10...diskcache_rs-v0.4.11) (2026-05-12)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * **deps:** update rust crate lru to 0.18 ([0c0138f](https://github.com/loonghao/diskcache_rs/commit/0c0138f65f4b6d16cd664db6720f927211e10a3f))
27
+ * optimize sqlite inline cache index ([5a885ba](https://github.com/loonghao/diskcache_rs/commit/5a885bafa8c5b0a7653773a94f32232dc0dfd3af))
28
+ * strengthen sqlite multiprocess consistency ([e121661](https://github.com/loonghao/diskcache_rs/commit/e121661cc1e6d8d54f7670bd471c3da4e776fb47))
29
+ * support django cache and multiprocess opens ([044f244](https://github.com/loonghao/diskcache_rs/commit/044f244b817d4db5ec3fd13cdfbac21f184ac032))
30
+
31
+
32
+ ### Performance Improvements
33
+
34
+ * avoid pickling bytes values ([b081349](https://github.com/loonghao/diskcache_rs/commit/b081349082265683b891a96dff23258849c273bc))
35
+ * keep medium values inline ([62ed5e7](https://github.com/loonghao/diskcache_rs/commit/62ed5e7f986b6d52887e00c61441ee1d01150235))
36
+ * restore sqlite hot-read path ([2da51ee](https://github.com/loonghao/diskcache_rs/commit/2da51ee478f631941a57c344805db40495f07386))
37
+
38
+ ## [0.4.10](https://github.com/loonghao/diskcache_rs/compare/diskcache_rs-v0.4.9...diskcache_rs-v0.4.10) (2026-04-15)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * **deps:** update rust crate redb to v4 ([910b7c4](https://github.com/loonghao/diskcache_rs/commit/910b7c4ac70fe4d2a3f0c81a8899ab6522f7f1b8))
44
+
7
45
  ## [0.4.9](https://github.com/loonghao/diskcache_rs/compare/diskcache_rs-v0.4.8...diskcache_rs-v0.4.9) (2026-03-25)
8
46
 
9
47
 
@@ -78,9 +78,9 @@ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
78
78
 
79
79
  [[package]]
80
80
  name = "blake3"
81
- version = "1.8.3"
81
+ version = "1.8.5"
82
82
  source = "registry+https://github.com/rust-lang/crates.io-index"
83
- checksum = "2468ef7d57b3fb7e16b576e8377cdbde2320c60e1491e961d11da40fc4f02a2d"
83
+ checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce"
84
84
  dependencies = [
85
85
  "arrayref",
86
86
  "arrayvec",
@@ -104,9 +104,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
104
104
 
105
105
  [[package]]
106
106
  name = "bytes"
107
- version = "1.11.1"
107
+ version = "1.12.0"
108
108
  source = "registry+https://github.com/rust-lang/crates.io-index"
109
- checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
109
+ checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593"
110
110
 
111
111
  [[package]]
112
112
  name = "cc"
@@ -126,9 +126,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
126
126
 
127
127
  [[package]]
128
128
  name = "chrono"
129
- version = "0.4.44"
129
+ version = "0.4.45"
130
130
  source = "registry+https://github.com/rust-lang/crates.io-index"
131
- checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0"
131
+ checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327"
132
132
  dependencies = [
133
133
  "iana-time-zone",
134
134
  "js-sys",
@@ -161,9 +161,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
161
161
 
162
162
  [[package]]
163
163
  name = "cpufeatures"
164
- version = "0.2.17"
164
+ version = "0.3.0"
165
165
  source = "registry+https://github.com/rust-lang/crates.io-index"
166
- checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
166
+ checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201"
167
167
  dependencies = [
168
168
  "libc",
169
169
  ]
@@ -232,9 +232,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
232
232
 
233
233
  [[package]]
234
234
  name = "dashmap"
235
- version = "6.1.0"
235
+ version = "6.2.1"
236
236
  source = "registry+https://github.com/rust-lang/crates.io-index"
237
- checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
237
+ checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c"
238
238
  dependencies = [
239
239
  "cfg-if",
240
240
  "crossbeam-utils",
@@ -246,7 +246,7 @@ dependencies = [
246
246
 
247
247
  [[package]]
248
248
  name = "diskcache_rs"
249
- version = "0.4.9"
249
+ version = "0.4.12"
250
250
  dependencies = [
251
251
  "anyhow",
252
252
  "bincode",
@@ -392,6 +392,15 @@ name = "hashbrown"
392
392
  version = "0.16.1"
393
393
  source = "registry+https://github.com/rust-lang/crates.io-index"
394
394
  checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
395
+ dependencies = [
396
+ "foldhash 0.2.0",
397
+ ]
398
+
399
+ [[package]]
400
+ name = "hashbrown"
401
+ version = "0.17.0"
402
+ source = "registry+https://github.com/rust-lang/crates.io-index"
403
+ checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51"
395
404
  dependencies = [
396
405
  "allocator-api2",
397
406
  "equivalent",
@@ -499,15 +508,15 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
499
508
 
500
509
  [[package]]
501
510
  name = "libc"
502
- version = "0.2.183"
511
+ version = "0.2.186"
503
512
  source = "registry+https://github.com/rust-lang/crates.io-index"
504
- checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
513
+ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
505
514
 
506
515
  [[package]]
507
516
  name = "libsqlite3-sys"
508
- version = "0.37.0"
517
+ version = "0.38.0"
509
518
  source = "registry+https://github.com/rust-lang/crates.io-index"
510
- checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1"
519
+ checksum = "a76001fb4daed01e5f2b518aac0b4dc592e7c734da63dbffcf0c64fa612a8d0c"
511
520
  dependencies = [
512
521
  "cc",
513
522
  "pkg-config",
@@ -537,18 +546,18 @@ checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
537
546
 
538
547
  [[package]]
539
548
  name = "lru"
540
- version = "0.16.3"
549
+ version = "0.18.0"
541
550
  source = "registry+https://github.com/rust-lang/crates.io-index"
542
- checksum = "a1dc47f592c06f33f8e3aea9591776ec7c9f9e4124778ff8a3c3b87159f7e593"
551
+ checksum = "8a860605968fce16869fd239cf4237a82f3ac470723415db603b0e8b6c8d4fb9"
543
552
  dependencies = [
544
- "hashbrown 0.16.1",
553
+ "hashbrown 0.17.0",
545
554
  ]
546
555
 
547
556
  [[package]]
548
557
  name = "lz4_flex"
549
- version = "0.13.0"
558
+ version = "0.13.1"
550
559
  source = "registry+https://github.com/rust-lang/crates.io-index"
551
- checksum = "db9a0d582c2874f68138a16ce1867e0ffde6c0bb0a0df85e1f36d04146db488a"
560
+ checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e"
552
561
  dependencies = [
553
562
  "twox-hash",
554
563
  ]
@@ -598,9 +607,9 @@ dependencies = [
598
607
 
599
608
  [[package]]
600
609
  name = "once_cell"
601
- version = "1.21.3"
610
+ version = "1.21.4"
602
611
  source = "registry+https://github.com/rust-lang/crates.io-index"
603
- checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
612
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
604
613
 
605
614
  [[package]]
606
615
  name = "parking_lot"
@@ -683,9 +692,9 @@ dependencies = [
683
692
 
684
693
  [[package]]
685
694
  name = "pyo3"
686
- version = "0.28.2"
695
+ version = "0.29.3"
687
696
  source = "registry+https://github.com/rust-lang/crates.io-index"
688
- checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
697
+ checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
689
698
  dependencies = [
690
699
  "libc",
691
700
  "once_cell",
@@ -697,18 +706,18 @@ dependencies = [
697
706
 
698
707
  [[package]]
699
708
  name = "pyo3-build-config"
700
- version = "0.28.2"
709
+ version = "0.29.3"
701
710
  source = "registry+https://github.com/rust-lang/crates.io-index"
702
- checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
711
+ checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
703
712
  dependencies = [
704
713
  "target-lexicon",
705
714
  ]
706
715
 
707
716
  [[package]]
708
717
  name = "pyo3-ffi"
709
- version = "0.28.2"
718
+ version = "0.29.3"
710
719
  source = "registry+https://github.com/rust-lang/crates.io-index"
711
- checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
720
+ checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
712
721
  dependencies = [
713
722
  "libc",
714
723
  "pyo3-build-config",
@@ -716,9 +725,9 @@ dependencies = [
716
725
 
717
726
  [[package]]
718
727
  name = "pyo3-macros"
719
- version = "0.28.2"
728
+ version = "0.29.3"
720
729
  source = "registry+https://github.com/rust-lang/crates.io-index"
721
- checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
730
+ checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
722
731
  dependencies = [
723
732
  "proc-macro2",
724
733
  "pyo3-macros-backend",
@@ -728,13 +737,12 @@ dependencies = [
728
737
 
729
738
  [[package]]
730
739
  name = "pyo3-macros-backend"
731
- version = "0.28.2"
740
+ version = "0.29.3"
732
741
  source = "registry+https://github.com/rust-lang/crates.io-index"
733
- checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
742
+ checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
734
743
  dependencies = [
735
744
  "heck",
736
745
  "proc-macro2",
737
- "pyo3-build-config",
738
746
  "quote",
739
747
  "syn",
740
748
  ]
@@ -756,9 +764,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
756
764
 
757
765
  [[package]]
758
766
  name = "redb"
759
- version = "3.1.1"
767
+ version = "4.1.0"
760
768
  source = "registry+https://github.com/rust-lang/crates.io-index"
761
- checksum = "ef99362319c782aa4639ad3a306b64c3bb90e12874e99b8df124cb679d988611"
769
+ checksum = "8e925444704b5f17d32bf42f5b6e2df050bceebc3dcd6e71cc73dafe8092e839"
762
770
  dependencies = [
763
771
  "libc",
764
772
  ]
@@ -795,9 +803,9 @@ dependencies = [
795
803
 
796
804
  [[package]]
797
805
  name = "rusqlite"
798
- version = "0.39.0"
806
+ version = "0.40.0"
799
807
  source = "registry+https://github.com/rust-lang/crates.io-index"
800
- checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e"
808
+ checksum = "1b3492ea85308705c3a5cc24fb9b9cf77273d30590349070db42991202b214c4"
801
809
  dependencies = [
802
810
  "bitflags",
803
811
  "chrono",
@@ -1052,9 +1060,9 @@ checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae"
1052
1060
 
1053
1061
  [[package]]
1054
1062
  name = "uuid"
1055
- version = "1.22.0"
1063
+ version = "1.23.3"
1056
1064
  source = "registry+https://github.com/rust-lang/crates.io-index"
1057
- checksum = "a68d3c8f01c0cfa54a75291d83601161799e4a89a39e0929f4b0354d88757a37"
1065
+ checksum = "144d6b123cef80b301b8f72a9e2ca4370ddec21950d0a103dd22c437006d2db7"
1058
1066
  dependencies = [
1059
1067
  "getrandom",
1060
1068
  "js-sys",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "diskcache_rs"
3
- version = "0.4.9"
3
+ version = "0.4.12"
4
4
  edition = "2021"
5
5
  authors = ["longhao <hal.long@outlook.com>"]
6
6
  description = "A high-performance disk cache implementation in Rust with Python bindings"
@@ -28,7 +28,7 @@ panic = "abort"
28
28
  strip = "symbols"
29
29
 
30
30
  [dependencies]
31
- pyo3 = { version = "0.28", features = ["extension-module"] }
31
+ pyo3 = { version = "0.29.3", features = ["extension-module"] }
32
32
  serde = { version = "1.0", features = ["derive"] }
33
33
  serde_json = "1.0"
34
34
  bincode = "2.0"
@@ -36,7 +36,7 @@ rmp-serde = "1.3"
36
36
  # Keep only what we actually use
37
37
  postcard = { version = "1.1", features = ["alloc"] }
38
38
  # SQLite for diskcache-compatible storage
39
- rusqlite = { version = "0.39", features = ["bundled", "blob", "chrono"] }
39
+ rusqlite = { version = "0.40", features = ["bundled", "blob", "chrono"] }
40
40
 
41
41
  # tokio removed - using std::thread instead for simplicity
42
42
  parking_lot = "0.12"
@@ -56,10 +56,10 @@ crossbeam = "0.8"
56
56
  # Cross-platform file locking for NFS support
57
57
  fs4 = "0.13"
58
58
 
59
- lru = "0.16"
59
+ lru = "0.18"
60
60
 
61
61
  # Embedded key-value database for persistent index
62
- redb = "3.1"
62
+ redb = "4.0"
63
63
 
64
64
  [lints.clippy]
65
65
  dbg_macro = "warn"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: diskcache_rs
3
- Version: 0.4.9
3
+ Version: 0.4.12
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License