diff --git a/.github/workflows/monitor_requirements_size_master.yml b/.github/workflows/monitor_requirements_size_master.yml index 1cebb907e6..af87292257 100644 --- a/.github/workflows/monitor_requirements_size_master.yml +++ b/.github/workflows/monitor_requirements_size_master.yml @@ -12,6 +12,7 @@ on: permissions: pull-requests: write contents: read + issues: write jobs: read-python-versions: diff --git a/bittensor/core/metagraph.py b/bittensor/core/metagraph.py index 633c139ea8..44f4a033c1 100644 --- a/bittensor/core/metagraph.py +++ b/bittensor/core/metagraph.py @@ -1391,7 +1391,7 @@ async def sync( await self._apply_extra_info(block=block) async def _initialize_subtensor( - self, subtensor: "AsyncSubtensor" + self, subtensor: Optional["AsyncSubtensor"] ) -> "AsyncSubtensor": """ Initializes the subtensor to be used for syncing the metagraph. @@ -1422,8 +1422,8 @@ async def _initialize_subtensor( # Lazy import due to circular import (subtensor -> metagraph, metagraph -> subtensor) from bittensor.core.async_subtensor import AsyncSubtensor - self.subtensor = AsyncSubtensor(network=self.chain_endpoint) - await self.subtensor.initialize() + subtensor = AsyncSubtensor(network=self.chain_endpoint) + await subtensor.initialize() self.subtensor = subtensor return subtensor @@ -1720,7 +1720,7 @@ def sync( # apply MetagraphInfo data to instance self._apply_extra_info(block=block) - def _initialize_subtensor(self, subtensor: "Subtensor") -> "Subtensor": + def _initialize_subtensor(self, subtensor: Optional["Subtensor"]) -> "Subtensor": """ Initializes the subtensor to be used for syncing the metagraph. @@ -1939,6 +1939,17 @@ async def async_metagraph( ) -> "AsyncMetagraph": """ Factory function to create an instantiated AsyncMetagraph, mainly for the ability to use sync at instantiation. + + Parameters: + netuid: The netuid of the subnet for which to create the AsyncMetagraph. + mechid: The mechid of the subnet for which to create the AsyncMetagraph. + network: The network to use for the AsyncMetagraph. + lite: Whether to use a lite version of the AsyncMetagraph. + sync: Whether to sync the AsyncMetagraph. + subtensor: The subtensor to use for the AsyncMetagraph. + + Returns: + AsyncMetagraph: The instantiated AsyncMetagraph. """ metagraph_ = AsyncMetagraph( netuid=netuid, diff --git a/bittensor/utils/__init__.py b/bittensor/utils/__init__.py index 419e00b79b..1dd9fd205c 100644 --- a/bittensor/utils/__init__.py +++ b/bittensor/utils/__init__.py @@ -140,7 +140,7 @@ def strtobool(val: str) -> Union[bool, Literal["==SUPRESS=="]]: def _get_explorer_root_url_by_network_from_map( network: str, network_map: dict[str, dict[str, str]] -) -> Optional[dict[str, str]]: +) -> dict[str, str]: """ Returns the explorer root url for the given network name from the given network map. @@ -151,7 +151,7 @@ def _get_explorer_root_url_by_network_from_map( Returns: The explorer url for the given network. Or None if the network is not in the network map. """ - explorer_urls: Optional[dict[str, str]] = {} + explorer_urls: dict[str, str] = {} for entity_nm, entity_network_map in network_map.items(): if network in entity_network_map: explorer_urls[entity_nm] = entity_network_map[network] @@ -161,7 +161,7 @@ def _get_explorer_root_url_by_network_from_map( def get_explorer_url_for_network( network: str, block_hash: str, network_map: dict[str, dict[str, str]] -) -> Optional[dict[str, str]]: +) -> dict[str, str]: """ Returns the explorer url for the given block hash and network. @@ -174,10 +174,10 @@ def get_explorer_url_for_network( The explorer url for the given block hash and network. Or None if the network is not known. """ - explorer_urls: Optional[dict[str, str]] = {} - # Will be None if the network is not known. i.e. not in network_map - explorer_root_urls: Optional[dict[str, str]] = ( - _get_explorer_root_url_by_network_from_map(network, network_map) + explorer_urls: dict[str, str] = {} + + explorer_root_urls: dict[str, str] = _get_explorer_root_url_by_network_from_map( + network, network_map ) if explorer_root_urls != {}: diff --git a/tests/e2e_tests/test_liquidity.py b/tests/e2e_tests/test_liquidity.py index 3408b5ab22..674278ef14 100644 --- a/tests/e2e_tests/test_liquidity.py +++ b/tests/e2e_tests/test_liquidity.py @@ -9,6 +9,7 @@ ) +@pytest.mark.skip("Skips user liquidity e2e test pending the rework") def test_liquidity(subtensor, alice_wallet, bob_wallet): """ Tests the liquidity mechanism @@ -281,6 +282,7 @@ def test_liquidity(subtensor, alice_wallet, bob_wallet): logging.console.info("✅ Passed [blue]test_liquidity[/blue]") +@pytest.mark.skip("Skips user liquidity e2e test pending the rework") @pytest.mark.asyncio async def test_liquidity_async(async_subtensor, alice_wallet, bob_wallet): """ diff --git a/tests/helpers/__init__.py b/tests/helpers/__init__.py index 9097d72d70..7aed5c7ad3 100644 --- a/tests/helpers/__init__.py +++ b/tests/helpers/__init__.py @@ -9,8 +9,3 @@ get_mock_keypair, get_mock_wallet, ) - - -def is_running_in_circleci(): - """Checks that tests are running in the app.circleci.com environment.""" - return os.getenv("CIRCLECI") == "true"