Skip to content

Inject a resource provider to decouple network access - #201

Merged
apriha merged 1 commit into
mainfrom
v3/resource-provider
Jul 2, 2026
Merged

Inject a resource provider to decouple network access#201
apriha merged 1 commit into
mainfrom
v3/resource-provider

Conversation

@apriha

@apriha apriha commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Decouples the network/resource layer from the core so every operation runs with
zero network and zero mocks. Resources are now obtained through an injected
ResourceProvider (default: a pooch-backed Resources), the Singleton is
gone, and the suite runs fully offline against a fixture-backed provider — the
real servers are contacted only by a weekly live-integration job.

Note: resources now cache to an OS-specific directory (override with
SNPS_DATA_DIR) instead of ./resources, so existing caches re-download once.
Adds pooch as a dependency.

🤖 Generated with Claude Code

@apriha
apriha force-pushed the v3/resource-provider branch from 7735cb2 to 41d89b4 Compare July 2, 2026 04:08
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 45.61404% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.54%. Comparing base (bfedc3b) to head (2a74ee0).

Files with missing lines Patch % Lines
src/snps/resources.py 42.59% 29 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #201      +/-   ##
==========================================
- Coverage   92.78%   88.54%   -4.24%     
==========================================
  Files          12       12              
  Lines        2147     2138       -9     
  Branches      344      344              
==========================================
- Hits         1992     1893      -99     
- Misses         89      181      +92     
+ Partials       66       64       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Move all resource downloading and caching behind a ResourceProvider so
operations run with zero network and zero mocks. Replace the hand-rolled
urllib downloader with pooch, cache resources in an OS-specific directory
(overridable via SNPS_DATA_DIR), and drop the Singleton on Resources in
favor of explicit injection into SNPs.

The suite now runs fully offline against a fixture-backed provider; the
real resource servers are exercised only by a dedicated weekly CI job.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@apriha
apriha force-pushed the v3/resource-provider branch from 41d89b4 to 2a74ee0 Compare July 2, 2026 04:19
@apriha
apriha merged commit 5ba1013 into main Jul 2, 2026
33 checks passed
@apriha
apriha deleted the v3/resource-provider branch July 2, 2026 04: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.

1 participant