Skip to content

Commit

Permalink
Merge pull request #434 from golemfactory/az/move-stuff-outside-executor
Browse files Browse the repository at this point in the history
Move some modules from yapapi/executor to yapapi/
  • Loading branch information
azawlocki authored Jun 8, 2021
2 parents fcb58bf + 4eb9bdf commit beab24e
Show file tree
Hide file tree
Showing 23 changed files with 1,090 additions and 1,012 deletions.
2 changes: 1 addition & 1 deletion examples/yacat/yacat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import AsyncIterable, List, Optional

from yapapi import Golem, NoPaymentAccountError, Task, WorkContext, windows_event_loop_fix
from yapapi.executor.events import CommandExecuted
from yapapi.events import CommandExecuted
from yapapi.log import enable_default_logger
from yapapi.payload import vm
from yapapi.rest.activity import CommandExecutionError
Expand Down
6 changes: 3 additions & 3 deletions tests/goth/test_resubscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
from goth.runner.probe import RequestorProbe

from yapapi import Executor, Task
from yapapi.executor.events import (
from yapapi.events import (
Event,
ComputationStarted,
ComputationFinished,
SubscriptionCreated,
)
import yapapi.rest.market
from yapapi.log import enable_default_logger
from yapapi.package import vm
from yapapi.payload import vm
import yapapi.rest.market

import ya_market.api.requestor_api
from ya_market import ApiException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from yapapi.executor import agreements_pool
from yapapi import agreements_pool


def mock_agreement(**properties):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pytest
import time

from yapapi.executor.utils import AsyncWrapper
from yapapi.utils import AsyncWrapper


def test_async_wrapper_ordering():
Expand Down
2 changes: 1 addition & 1 deletion tests/executor/test_ctx.py → tests/test_ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
from unittest import mock

from yapapi.executor.ctx import CommandContainer, WorkContext
from yapapi.ctx import CommandContainer, WorkContext

from tests.factories.props import NodeInfoFactory

Expand Down
4 changes: 1 addition & 3 deletions tests/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
import sys
import tempfile

import pytest

from yapapi.executor.events import ComputationFinished
from yapapi.events import ComputationFinished
from yapapi.log import enable_default_logger, log_event, log_event_repr


Expand Down
6 changes: 3 additions & 3 deletions tests/executor/test_strategy.py → tests/test_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from unittest.mock import Mock

from yapapi import Golem
from yapapi.executor.strategy import (
from yapapi.props.com import Counter
import yapapi.rest.configuration
from yapapi.strategy import (
DecreaseScoreForUnconfirmedAgreement,
LeastExpensiveLinearPayuMS,
SCORE_TRUSTED,
SCORE_REJECTED,
SCORE_NEUTRAL,
)
from yapapi.props.com import Counter
import yapapi.rest.configuration

from tests.factories.rest.market import OfferProposalFactory

Expand Down
12 changes: 3 additions & 9 deletions yapapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@
from pathlib import Path
from pkg_resources import get_distribution

from .executor import (
CaptureContext,
ExecOptions,
Executor,
Task,
WorkContext,
)

from yapapi.ctx import ExecOptions, Work, WorkContext
from yapapi.engine import NoPaymentAccountError, WorkItem
from yapapi.executor import Executor, Task
from yapapi.golem import Golem


Expand Down Expand Up @@ -57,9 +51,9 @@ class _WindowsEventPolicy(asyncio.events.BaseDefaultEventLoopPolicy):
"storage",
"Task",
"WorkContext",
"CaptureContext",
"ExecOptions",
"Golem",
"NoPaymentAccountError",
"Work",
"WorkItem",
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys
from typing import Dict, NamedTuple, Optional, Set, Tuple

from yapapi.executor import events
from yapapi import events
from yapapi.props import Activity, NodeInfo
from yapapi.rest.market import Agreement, ApiException, OfferProposal

Expand Down
Loading

0 comments on commit beab24e

Please sign in to comment.