Skip to content

Commit

Permalink
Remove deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jfhbrook committed Nov 23, 2023
1 parent b3a248f commit 13ec927
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 108 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

- Remove deprecated imports:
- `pyee.BaseEventEmitter`
- `pyee.AsyncIOEventEmitter`
- `pyee.TwistedEventEmitter`
- `pyee.ExecutorEventEmitter`
- `pyee.TrioEventEmitter`

## 2023/11/23 Version 11.1.0

- Generate a man page with Sphinx (in addition to mkdocs HTML)
Expand Down
2 changes: 0 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
options:
members:
- EventEmitter
- BaseEventEmitter
- AsyncIOEventEmitter
- PyeeException
show_root_heading: false

Expand Down
108 changes: 2 additions & 106 deletions pyee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,110 +27,6 @@
"""

from warnings import warn
from pyee.base import EventEmitter, PyeeException

from pyee.base import EventEmitter as EventEmitter
from pyee.base import PyeeException


class BaseEventEmitter(EventEmitter):
"""
BaseEventEmitter is deprecated and an alias for EventEmitter.
"""

def __init__(self):
warn(
DeprecationWarning(
"pyee.BaseEventEmitter is deprecated and will be removed in a "
"future major version; you should instead use pyee.EventEmitter."
)
)

super(BaseEventEmitter, self).__init__()


__all__ = ["BaseEventEmitter", "EventEmitter", "PyeeException"]

try:
from pyee.asyncio import AsyncIOEventEmitter as _AsyncIOEventEmitter # noqa

class AsyncIOEventEmitter(_AsyncIOEventEmitter):
"""
AsyncIOEventEmitter has been moved to the pyee.asyncio module.
"""

def __init__(self, loop=None):
warn(
DeprecationWarning(
"pyee.AsyncIOEventEmitter has been moved to the pyee.asyncio "
"module."
)
)
super(AsyncIOEventEmitter, self).__init__(loop=loop)

__all__.append("AsyncIOEventEmitter")
except ImportError:
pass

try:
from pyee.twisted import TwistedEventEmitter as _TwistedEventEmitter # noqa

class TwistedEventEmitter(_TwistedEventEmitter):
"""
TwistedEventEmitter has been moved to the pyee.twisted module.
"""

def __init__(self):
warn(
DeprecationWarning(
"pyee.TwistedEventEmitter has been moved to the pyee.twisted "
"module."
)
)
super(TwistedEventEmitter, self).__init__()

__all__.append("TwistedEventEmitter")
except ImportError:
pass

try:
from pyee.executor import ExecutorEventEmitter as _ExecutorEventEmitter # noqa

class ExecutorEventEmitter(_ExecutorEventEmitter):
"""
ExecutorEventEmitter has been moved to the pyee.executor module.
"""

def __init__(self, executor=None):
warn(
DeprecationWarning(
"pyee.ExecutorEventEmitter has been moved to the pyee.executor "
"module."
)
)
super(ExecutorEventEmitter, self).__init__(executor=executor)

__all__.append("ExecutorEventEmitter")
except ImportError:
pass

try:
from pyee.trio import TrioEventEmitter as _TrioEventEmitter # noqa

class TrioEventEmitter(_TrioEventEmitter):
"""
TrioEventEmitter has been moved to the pyee.trio module.
"""

def __init__(self, nursery=None, manager=None):
warn(
DeprecationWarning(
"pyee.TrioEventEmitter has been moved to the pyee.trio module."
)
)

super(TrioEventEmitter, self).__init__(nursery=nursery, manager=manager)

__all__.append("TrioEventEmitter")
except (ImportError, SyntaxError):
pass
__all__ = ["EventEmitter", "PyeeException"]

0 comments on commit 13ec927

Please sign in to comment.