Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ jobs:
- name: "Docs"
python: "3.15"
tox: docs
- name: "pytest (3.10)"
python: "3.10"
tox: "3.10"
- name: "pytest (3.11)"
python: "3.11"
tox: "3.11"
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Guidance for coding agents that work in this repo.

Pykka is a Python implementation of the actor model. It supports Python 3.10
Pykka is a Python implementation of the actor model. It supports Python 3.11
and newer, and has no runtime dependencies.

## Layout
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ which makes it easier to build concurrent applications.

## Installation

Pykka has no dependencies other than Python 3.10 or newer.
Pykka has no dependencies other than Python 3.11 or newer.
It can be installed from [PyPI](https://pypi.org/project/pykka/):

```console
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ applications.

## Installation

Pykka has no dependencies other than Python 3.10 or newer.
Pykka has no dependencies other than Python 3.11 or newer.
It can be installed from [PyPI](https://pypi.org/project/pykka/):

```console
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "pykka",
# ]
Expand Down
2 changes: 1 addition & 1 deletion examples/cooperation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "pykka",
# ]
Expand Down
2 changes: 1 addition & 1 deletion examples/deadlock.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "pykka",
# ]
Expand Down
2 changes: 1 addition & 1 deletion examples/proxy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "pykka",
# ]
Expand Down
2 changes: 1 addition & 1 deletion examples/worker_pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# requires-python = ">=3.11"
# dependencies = [
# "pykka",
# ]
Expand Down
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "pykka"
version = "4.4.2"
description = "Pykka is a Python implementation of the actor model"
authors = [{ name = "Stein Magnus Jodal", email = "stein.magnus@jodal.no" }]
requires-python = ">=3.10"
requires-python = ">=3.11"
readme = "README.md"
license = "Apache-2.0"
keywords = ["actor", "concurrency", "threading"]
Expand Down Expand Up @@ -75,17 +75,14 @@ ignore_missing_imports = true


[tool.pyright]
pythonVersion = "3.10"
pythonVersion = "3.11"
typeCheckingMode = "strict"
# Already coverd by tests and careful import ordering:
reportImportCycles = false
# Already covered by flake8-self:
reportPrivateUsage = false


[tool.ruff]
target-version = "py310"

[tool.ruff.lint]
select = ["ALL"]
ignore = [
Expand All @@ -96,7 +93,6 @@ ignore = [
"D213", # multi-line-summary-second-line
"G004", # logging-f-string
"PLR2004", # magic-value-comparison
"PYI019", # custom-type-var-for-self -- Remove when requiring Python 3.11
"RET504", # unnecessary-assign
"S101", # assert
"TRY003", # raise-vanilla-args
Expand Down Expand Up @@ -136,7 +132,6 @@ keep-runtime-typing = true

[tool.tox]
env_list = [
"3.10",
"3.11",
"3.12",
"3.13",
Expand Down
11 changes: 4 additions & 7 deletions src/pykka/_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys
import threading
import uuid
from typing import TYPE_CHECKING, Any, Protocol, TypeVar
from typing import TYPE_CHECKING, Any, Protocol, Self

from pykka import ActorDeadError, ActorRef, ActorRegistry, messages
from pykka._introspection import get_attr_directly
Expand All @@ -22,9 +22,6 @@
logger = logging.getLogger("pykka")


A = TypeVar("A", bound="Actor")


class ActorInbox(Protocol):
def put(self, envelope: Envelope[Any], /) -> None: ...

Expand Down Expand Up @@ -81,10 +78,10 @@ def a_method(self, ...):

@classmethod
def start(
cls: type[A],
cls,
*args: Any,
**kwargs: Any,
) -> ActorRef[A]:
) -> ActorRef[Self]:
"""Start an actor.

Starting an actor also registers it in the
Expand Down Expand Up @@ -174,7 +171,7 @@ def _start_actor_loop(self) -> None:
_actor_ref: ActorRef[Any]

@property
def actor_ref(self: A) -> ActorRef[A]:
def actor_ref(self) -> ActorRef[Self]:
"""The actor's [`ActorRef`][pykka.ActorRef] instance."""
# This property only exists to improve the typing of the ActorRef.
return self._actor_ref
Expand Down
4 changes: 2 additions & 2 deletions tests/log_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import logging
import threading
import time
from enum import Enum
from enum import StrEnum
from typing import Any


class LogLevel(str, Enum):
class LogLevel(StrEnum):
DEBUG = "debug"
INFO = "info"
WARNING = "warning"
Expand Down
Loading