Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove Python < 3.9 support (#728) #730

Merged
merged 5 commits into from
Jan 24, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ users are encouraged to not use gevent in asyncio applications (including Tempor

# Development

The Python SDK is built to work with Python 3.8 and newer. It is built using
The Python SDK is built to work with Python 3.9 and newer. It is built using
[SDK Core](https://github.com/temporalio/sdk-core/) which is written in Rust.

### Building
Expand Down
2 changes: 1 addition & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def build(setup_kwargs):
path="temporalio/bridge/Cargo.toml",
binding=Binding.PyO3,
py_limited_api=True,
features=["pyo3/abi3-py38"],
features=["pyo3/abi3-py39"],
)
],
zip_safe=False,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ exclude = [
]

[tool.ruff]
target-version = "py38"
target-version = "py39"

[build-system]
build-backend = "poetry.core.masonry.api"
Expand Down
6 changes: 0 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
from temporalio.testing import WorkflowEnvironment
from tests.helpers.worker import ExternalPythonWorker, ExternalWorker

# Due to https://github.com/python/cpython/issues/77906, multiprocessing on
# macOS starting with Python 3.8 has changed from "fork" to "spawn". For
# pre-3.8, we are changing it for them.
if sys.version_info < (3, 8) and sys.platform.startswith("darwin"):
multiprocessing.set_start_method("spawn", True)


def pytest_addoption(parser):
parser.addoption(
Expand Down
40 changes: 25 additions & 15 deletions tests/worker/test_replayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,11 @@ async def test_replayer_workflow_nondeterministic(client: Client) -> None:


async def test_replayer_workflow_nondeterministic_json() -> None:
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
"r"
) as f:
with (
Path(__file__)
.with_name("test_replayer_nondeterministic_history.json")
.open("r") as f
):
history_json = f.read()
with pytest.raises(workflow.NondeterminismError):
await Replayer(workflows=[SayHelloWorkflow]).replay_workflow(
Expand All @@ -184,9 +186,11 @@ async def test_replayer_workflow_nondeterministic_json() -> None:
async def test_replayer_multiple_histories_fail_fast() -> None:
with Path(__file__).with_name("test_replayer_complete_history.json").open("r") as f:
history_json = f.read()
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
"r"
) as f:
with (
Path(__file__)
.with_name("test_replayer_nondeterministic_history.json")
.open("r") as f
):
history_json_bad = f.read()

callcount = 0
Expand All @@ -210,9 +214,11 @@ async def histories():
async def test_replayer_multiple_histories_fail_slow() -> None:
with Path(__file__).with_name("test_replayer_complete_history.json").open("r") as f:
history_json = f.read()
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
"r"
) as f:
with (
Path(__file__)
.with_name("test_replayer_nondeterministic_history.json")
.open("r") as f
):
history_json_bad = f.read()

callcount = 0
Expand Down Expand Up @@ -389,9 +395,11 @@ async def test_replayer_command_reordering_backward_compatibility() -> None:
to [UpdateAccepted, CompleteWorkflowExecution], and events 5 and 6 can be applied to the
corresponding state machines.
"""
with Path(__file__).with_name(
"test_replayer_command_reordering_backward_compatibility.json"
).open() as f:
with (
Path(__file__)
.with_name("test_replayer_command_reordering_backward_compatibility.json")
.open() as f
):
history = f.read()
await Replayer(workflows=[UpdateCompletionAfterWorkflowReturn]).replay_workflow(
WorkflowHistory.from_json("fake", history)
Expand Down Expand Up @@ -475,9 +483,11 @@ async def test_replayer_async_ordering() -> None:


async def test_replayer_alternate_async_ordering() -> None:
with Path(__file__).with_name(
"test_replayer_event_tracing_alternate.json"
).open() as f:
with (
Path(__file__)
.with_name("test_replayer_event_tracing_alternate.json")
.open() as f
):
history = f.read()
await Replayer(
workflows=[ActivityAndSignalsWhileWorkflowDown],
Expand Down
Loading