Skip to content

Commit

Permalink
Move agreements_pool.py, ctx.py and utils.py from yapapi/executor/ to…
Browse files Browse the repository at this point in the history
… yapapi/
  • Loading branch information
azawlocki committed Jun 7, 2021
1 parent 00f5688 commit b00c610
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 25 deletions.
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
File renamed without changes.
10 changes: 2 additions & 8 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 CaptureContext, ExecOptions, WorkContext
from yapapi.engine import NoPaymentAccountError, WorkItem
from yapapi.executor import Executor, Task
from yapapi.golem import Golem


Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions yapapi/executor/ctx.py → yapapi/ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from typing import Callable, Iterable, Optional, Dict, List, Tuple, Union, Any, Awaitable

from yapapi.events import DownloadStarted, DownloadFinished
from ..props import NodeInfo
from ..storage import StorageProvider, Source, Destination, DOWNLOAD_BYTES_LIMIT_DEFAULT
from yapapi.props import NodeInfo
from yapapi.storage import StorageProvider, Source, Destination, DOWNLOAD_BYTES_LIMIT_DEFAULT


class CommandContainer:
Expand Down
6 changes: 3 additions & 3 deletions yapapi/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@


from yapapi import rest, events
from yapapi.executor import AgreementsPool
from yapapi.executor.ctx import CommandContainer, ExecOptions, Work
from yapapi.executor.utils import AsyncWrapper
from yapapi.agreements_pool import AgreementsPool
from yapapi.ctx import CommandContainer, ExecOptions, Work
from yapapi.payload import Payload
from yapapi.props import com, Activity, NodeInfo, NodeInfoKeys
from yapapi.props.builder import DemandBuilder, DemandDecorator
Expand All @@ -45,6 +44,7 @@
MarketStrategy,
SCORE_NEUTRAL,
)
from yapapi.utils import AsyncWrapper


DEBIT_NOTE_MIN_TIMEOUT: Final[int] = 30 # in seconds
Expand Down
11 changes: 4 additions & 7 deletions yapapi/executor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@
from typing_extensions import Final, AsyncGenerator
import warnings

from yapapi import rest, events
from yapapi.ctx import WorkContext
from yapapi.events import Event
from yapapi.executor.agreements_pool import AgreementsPool
from yapapi.payload import Payload
from yapapi.props import NodeInfo
from yapapi.strategy import MarketStrategy

from .ctx import CaptureContext, CommandContainer, ExecOptions, Work, WorkContext
from .task import Task, TaskStatus
from ..payload import Payload
from ..props import NodeInfo
from .. import rest, events
from ._smartq import SmartQueue


Expand All @@ -54,8 +53,6 @@


from yapapi.engine import _Engine, Job, WorkItem
from yapapi.executor.ctx import Work


D = TypeVar("D") # Type var for task data
R = TypeVar("R") # Type var for task result
Expand Down
2 changes: 1 addition & 1 deletion yapapi/golem.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from typing_extensions import AsyncGenerator

from yapapi import events
from yapapi.ctx import WorkContext
from yapapi.engine import _Engine, WorkItem
from yapapi.executor import Executor
from yapapi.executor.ctx import WorkContext
from yapapi.executor.task import Task
from yapapi.payload import Payload
from yapapi.services import Cluster, Service
Expand Down
2 changes: 1 addition & 1 deletion yapapi/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from typing_extensions import Final

from yapapi import rest, events
from yapapi.ctx import WorkContext
from yapapi.engine import _Engine, Job
from yapapi.executor.ctx import WorkContext
from yapapi.payload import Payload
from yapapi.props import NodeInfo

Expand Down
File renamed without changes.

0 comments on commit b00c610

Please sign in to comment.