Releases: jodal/pykka
v3.1.1
v3.1.0
Breaking changes
- Remove support for Python 3.6. It reached end-of-life in December 2021. (PR: #159)
Bug fixes
- Include docs, examples, and tests in the source release. (Fixes: #171)
Development environment
- Require mypy 0.960 and use the latest typing features, as these seem to work nicely even on Python 3.7, given that the typing information is in separate
*.pyifiles and that you have a recent mypy version.
v3.0.2
v3.0.1
v3.0.0
Breaking changes
- Remove support for Python 2.7. It reached end-of-life in January 2020. (PR: #87)
- Remove support for Python 3.5. It reached end-of-life in September 2020. (PR: :#89)
- Remove support for running actors on top of eventlet. This was deprecated in Pykka 2.0.3. (PR: #111)
- Remove support for running actors on top of gevent. This was deprecated in Pykka 2.0.3 (PR: #111)
- Remove support for automatically upgrading the internal message format used by Pykka < 2.0 to the message types used by Pykka >= 2.0. (PR: #88)
Features
- Include complete type hint stubs for all public APIs in the PyPI distribution. (PR: #92)
Development environment
- Remove PyPy from the test matrix. There are no known changes that should cause Pykka to stop working on PyPy, but we will no longer spend any effort to keep CI for PyPy running. (PR: #113)
v2.0.3 (2020-11-27)
Bugfix release.
-
Mark eventlet and gevent support as deprecated. The support will be removed in Pykka 3.0.
These were somewhat interesting ways to implement concurrency in Python when Pykka was conceived in 2011. Today, it is unclear it these libraries still have any mindshare or if keeping the support for them just adds an unnecessary burden to Pykka's maintenance.
-
Include Python 3.9 in the test matrix. (PR: #98)
-
Add missing
Nonedefault value for thetimeoutkeyword argument topykka.eventlet.EventletEvent.wait(), so that it matches thethreading.EventAPI. (PR: #91)
v2.0.2 (2019-12-02)
Bugfix release.
- Fix test suite when executed with pytest-mocker >= 1.11.2. (Fixes: #85)
v2.0.1 (2019-10-10)
Bugfix release.
- Make
pykka.ActorRefhashable.
v2.0.0 (2019-05-07)
Major feature release.
Dependencies
-
Drop support for Python 2.6, 3.2, 3.3, and 3.4. All have reached their end of life and do no longer receive security updates.
-
Include CPython 3.5, 3.6, 3.7, and 3.8 pre-releases, and PyPy 3.5 in the test matrix.
-
Include gevent and Eventlet tests in all environments. Since Pykka was originally developed, both have grown support for Python 3 and PyPy.
-
On Python 3, import
CallableandIterablefromcollections.abcinstead ofcollections. This fixes a deprecation warning on Python 3.7 and prepares for Python 3.8.
Actors
-
Actor messages are no longer required to be
dictobjects. Any object type can be used as an actor message. (Fixes: #39, #45, PR: #79)For existing code, this means that
pykka.Actor.on_receive()implementations should no longer assume the received message to be a
dict, and guard with the appropriate amount ofisinstance()checks. As an existing application will not observe any new message types before it starts using them itself, this is not marked as backward incompatible.
Proxies
-
Backwards incompatible: Avoid accessing actor properties when creating a proxy for the actor. For properties with side effects, this is a major bug fix. For properties which do heavy work, this is a major startup performance improvement.
This is backward incompatible if you in a property getter returned an object instance with the
pykka_traversablemarker. Previously, this would work just like a traversable attribute. Now, the property always returns a future with the property getter's return value. -
Fix infinite recursion when creating a proxy for an actor with an attribute or method replaced with a
unittest.mock.Mockwithout aspecdefined. (Fixes: #26, #27) -
Fix infinite recursion when creating a proxy for an actor with an attribute that was itself a proxy to the same actor. The attribute will now be ignored and a warning log message will ask you to consider making the self-proxy private. (Fixes: #48)
-
Add
pykka.CallableProxy.defer()to support method calls through a proxy withpykka.ActorRef.tell()semantics. (Contributed by Andrey Gubarev. Fixes: #63. PR: #72) -
Add
pykka.traversable()for marking an actor's attributes as traversable when used through actor proxies. The old way of manually adding apykka_traversableattribute to the object to be traversed still works, but the new function is recommended as it provides protection against typos in the marker name, and keeps the traversable marking in the actor class itself. (PR: #81)
Futures
-
Backwards incompatible:
pykka.Future.set_exception()no longer accepts an exception instance, which was deprecated in 0.15. The method can be called with either anexc_infotuple orNone, in which case it will usesys.exc_info()to get information on the current exception. -
Backwards incompatible:
pykka.Future.map()on a future with an iterable result no longer applies the map function to each item in iterable. Instead, the entire future result is passed to the map function. (Fixes: :issue:64)To upgrade existing code, make sure to explicitly apply the core of your map function to each item in the iterable:
>>> f = pykka.ThreadingFuture() >>> f.set([1, 2, 3]) >>> f.map(lambda x: x + 1).get() # Pykka < 2.0 [2, 3, 4] >>> f.map(lambda x: [i + 1 for i in x]).get() # Pykka >= 2.0 [2, 3, 4]
This change makes it easy to use :meth:
pykka.Future.mapto extract a field from a future that returns a dict:>>> f = pykka.ThreadingFuture() >>> f.set({'foo': 'bar'}) >>> f.map(lambda x: x['foo']).get() 'bar'
Because
dictis an iterable, the now removed special handling of iterables made this pattern difficult to use. -
Reuse result from
pykka.Future.filter(),pykka.Future.map(), andpykka.Future.reduce(). Recalculating the result on each call topykka.Future.get()is both inconsistent with regular futures and can cause problems if the function is expensive or has side effects. (Fixes: #32) -
If using Python 3.5+, one can now use the
awaitkeyword to get the result from a future. (Contributed by Joshua Doncaster-Marsiglio. PR: #78)
Logging
-
Pykka's use of different log levels has been documented.
-
Exceptions raised by an actor that are captured into a reply future are now logged on the
logging.INFOlevel instead of thelogging.DEBUGlevel. This makes it possible to detect potentially unhandled exceptions during development without having to turn on debug logging, which can have a low signal-to-noise ratio. (Contributed by Stefan Möhl. Fixes: #73)
Gevent support
- Ensure that the original traceback is preserved when an exception is returned through a future from a Gevent actor. (Contributed by Arne Brutschy. Fixes: #74, PR: #75)
Internals
-
Backwards incompatible: Prefix all internal modules with
_. This is backward-incompatible if you have imported objects from other import paths than what is used in the documentation. -
Port tests to pytest.
-
Format code with Black.
-
Change internal messaging format from
dicttonamedtuple. (PR: #80)