-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backward-compatible proxy versions of modules moved from executor/
- Loading branch information
Showing
5 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from deprecated import deprecated # type: ignore | ||
|
||
import yapapi.ctx | ||
from yapapi.utils import show_module_deprecation_warning | ||
|
||
|
||
_deprecation_version = "0.6.0" | ||
_deprecation_reason = "Please use the class with the same name defined in yapapi.ctx instead" | ||
|
||
|
||
show_module_deprecation_warning("yapapi.executor.ctx", "yapapi.ctx", _deprecation_version) | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class CommandContainer(yapapi.ctx.CommandContainer): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class ExecOptions(yapapi.ctx.ExecOptions): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class Work(yapapi.ctx.Work): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class WorkContext(yapapi.ctx.WorkContext): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from deprecated.classic import ClassicAdapter # type: ignore | ||
|
||
import yapapi.events | ||
from yapapi.utils import show_module_deprecation_warning | ||
|
||
|
||
_deprecation_version = "0.6.0" | ||
_deprecation_reason = "Please use the class with the same name defined in yapapi.events instead" | ||
|
||
|
||
show_module_deprecation_warning("yapapi.executor.events", "yapapi.events", _deprecation_version) | ||
|
||
|
||
for id, item in yapapi.events.__dict__.items(): | ||
# For each subclass `E` of `yapapi.events.Event`, produce a subclass `yapapi.executor.events.E` | ||
# decorated with @deprecated(_deprecation_version, _deprecation_reason) | ||
if isinstance(item, type) and issubclass(item, yapapi.events.Event): | ||
_subclass = type(id, (item,), {}) | ||
_adapter = ClassicAdapter(version=_deprecation_version, reason=_deprecation_reason) | ||
_wrapped = _adapter(_subclass) | ||
globals()[id] = _wrapped |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from deprecated import deprecated # type: ignore | ||
|
||
import yapapi.strategy | ||
from yapapi.strategy import SCORE_NEUTRAL, SCORE_REJECTED, SCORE_TRUSTED | ||
from yapapi.utils import show_module_deprecation_warning | ||
|
||
|
||
_deprecation_version = "0.6.0" | ||
_deprecation_reason = "Please use the class with the same name defined in yapapi.strategy instead" | ||
|
||
|
||
show_module_deprecation_warning("yapapi.executor.strategy", "yapapi.strategy", _deprecation_version) | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class MarketStrategy(yapapi.strategy.MarketStrategy): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class DummyMS(yapapi.strategy.DummyMS): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class LeastExpensiveLinearPayuMS(yapapi.strategy.LeastExpensiveLinearPayuMS): | ||
pass | ||
|
||
|
||
@deprecated(version=_deprecation_version, reason=_deprecation_reason) | ||
class DecreaseScoreForUnconfirmedAgreement(yapapi.strategy.DecreaseScoreForUnconfirmedAgreement): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters