Skip to content

Commit

Permalink
BACK-1791: clean up and update offchain to v0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
zylora committed Nov 10, 2023
1 parent b348972 commit c9048a2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 38 deletions.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.2.7

- Clean up an unused and obsolete `DEFAULT_ADAPTER_CONFIGS` symbol.

## v0.2.6

- Ensure `MetadataFetcher`'s outgoing IPFS http/s requests get re-routed to `IPFSAdapter` under default configuration.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Getting Started

Documentation for version: **v0.2.6**
Documentation for version: **v0.2.7**

## Overview

Expand Down
37 changes: 1 addition & 36 deletions offchain/metadata/pipelines/metadata_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@

from offchain.concurrency import batched_parmap
from offchain.logger.logging import logger
from offchain.metadata.adapters import ( # type: ignore[attr-defined]
ARWeaveAdapter,
DataURIAdapter,
HTTPAdapter,
IPFSAdapter,
)
from offchain.metadata.adapters.base_adapter import Adapter, AdapterConfig
from offchain.metadata.adapters import Adapter, AdapterConfig, DEFAULT_ADAPTER_CONFIGS
from offchain.metadata.fetchers.base_fetcher import BaseFetcher
from offchain.metadata.fetchers.metadata_fetcher import MetadataFetcher
from offchain.metadata.models.metadata import Metadata
Expand All @@ -23,31 +17,6 @@
from offchain.metadata.registries.parser_registry import ParserRegistry
from offchain.web3.contract_caller import ContractCaller

# TODO(luke): move the data repo's usage of this symbol to the new file, then remove this
DEFAULT_ADAPTER_CONFIGS: list[AdapterConfig] = [
AdapterConfig(
adapter_cls=ARWeaveAdapter,
mount_prefixes=["ar://"],
host_prefixes=["https://arweave.net/"],
kwargs={"pool_connections": 100, "pool_maxsize": 1000, "max_retries": 0},
),
AdapterConfig(adapter_cls=DataURIAdapter, mount_prefixes=["data:"]),
AdapterConfig(
adapter_cls=IPFSAdapter,
mount_prefixes=[
"ipfs://",
"https://gateway.pinata.cloud/",
"https://ipfs.io/",
],
host_prefixes=["https://gateway.pinata.cloud/ipfs/"],
kwargs={"pool_connections": 100, "pool_maxsize": 1000, "max_retries": 0},
),
AdapterConfig(
adapter_cls=HTTPAdapter,
mount_prefixes=["https://", "http://"],
kwargs={"pool_connections": 100, "pool_maxsize": 1000, "max_retries": 0},
),
]

DEFAULT_PARSERS = (
ParserRegistry.get_all_collection_parsers()
Expand Down Expand Up @@ -80,10 +49,6 @@ def __init__(
self.contract_caller = contract_caller or ContractCaller()
self.fetcher = fetcher or MetadataFetcher(async_adapter_configs=adapter_configs)
if adapter_configs is None:
# TODO(luke): move the line below to the file's import section once this
# file's DEFAULT_ADAPTER_CONFIGS is gone
from offchain.metadata.adapters import DEFAULT_ADAPTER_CONFIGS

adapter_configs = DEFAULT_ADAPTER_CONFIGS
for adapter_config in adapter_configs:
self.mount_adapter(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "offchain"
version = "0.2.6"
version = "0.2.7"
description = "Open source metadata processing framework"
authors = ["Zora eng <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit c9048a2

Please sign in to comment.