Make IPFS/Web3 dependencies optional in ipfs_storage_service
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled
Coordinator API: - Changed ipfshttpclient and web3 imports to optional - Service now starts without IPFS/Web3 dependencies - Logs warning instead of raising ImportError - IPFS features disabled when dependencies not available
This commit is contained in:
@@ -17,12 +17,15 @@ from typing import Any
|
|||||||
|
|
||||||
from .secure_pickle import safe_loads
|
from .secure_pickle import safe_loads
|
||||||
|
|
||||||
|
# Optional IPFS/Web3 dependencies
|
||||||
|
ipfshttpclient = None
|
||||||
|
web3 = None
|
||||||
try:
|
try:
|
||||||
import ipfshttpclient
|
import ipfshttpclient
|
||||||
from web3 import Web3
|
from web3 import Web3
|
||||||
|
web3 = Web3
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.error(f"IPFS/Web3 dependencies not installed: {e}")
|
logger.warning(f"IPFS/Web3 dependencies not installed: {e}. IPFS features will be disabled.")
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
|
|||||||
Reference in New Issue
Block a user