Skip to content

Commit 07d3567

Browse files
authored
chore: remove Python < 3.9 support (#728) (#730)
* chore: remove Python < 3.9 logic and update dependencies (#728) - Bump the minimum supported Python version from 3.8 to 3.9 - Remove macOS-specific code for Python < 3.8 - Update references in README, build.py, and poetry.lock accordingly Closes #728 * rollback poetry.lock file * fixed code formatting
1 parent 044b1de commit 07d3567

File tree

5 files changed

+28
-24
lines changed

5 files changed

+28
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ users are encouraged to not use gevent in asyncio applications (including Tempor
13731373

13741374
# Development
13751375

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

13791379
### Building

build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def build(setup_kwargs):
1616
path="temporalio/bridge/Cargo.toml",
1717
binding=Binding.PyO3,
1818
py_limited_api=True,
19-
features=["pyo3/abi3-py38"],
19+
features=["pyo3/abi3-py39"],
2020
)
2121
],
2222
zip_safe=False,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ exclude = [
214214
]
215215

216216
[tool.ruff]
217-
target-version = "py38"
217+
target-version = "py39"
218218

219219
[build-system]
220220
build-backend = "poetry.core.masonry.api"

tests/conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,6 @@
3939
from temporalio.testing import WorkflowEnvironment
4040
from tests.helpers.worker import ExternalPythonWorker, ExternalWorker
4141

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

4943
def pytest_addoption(parser):
5044
parser.addoption(

tests/worker/test_replayer.py

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,11 @@ async def test_replayer_workflow_nondeterministic(client: Client) -> None:
171171

172172

173173
async def test_replayer_workflow_nondeterministic_json() -> None:
174-
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
175-
"r"
176-
) as f:
174+
with (
175+
Path(__file__)
176+
.with_name("test_replayer_nondeterministic_history.json")
177+
.open("r") as f
178+
):
177179
history_json = f.read()
178180
with pytest.raises(workflow.NondeterminismError):
179181
await Replayer(workflows=[SayHelloWorkflow]).replay_workflow(
@@ -184,9 +186,11 @@ async def test_replayer_workflow_nondeterministic_json() -> None:
184186
async def test_replayer_multiple_histories_fail_fast() -> None:
185187
with Path(__file__).with_name("test_replayer_complete_history.json").open("r") as f:
186188
history_json = f.read()
187-
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
188-
"r"
189-
) as f:
189+
with (
190+
Path(__file__)
191+
.with_name("test_replayer_nondeterministic_history.json")
192+
.open("r") as f
193+
):
190194
history_json_bad = f.read()
191195

192196
callcount = 0
@@ -210,9 +214,11 @@ async def histories():
210214
async def test_replayer_multiple_histories_fail_slow() -> None:
211215
with Path(__file__).with_name("test_replayer_complete_history.json").open("r") as f:
212216
history_json = f.read()
213-
with Path(__file__).with_name("test_replayer_nondeterministic_history.json").open(
214-
"r"
215-
) as f:
217+
with (
218+
Path(__file__)
219+
.with_name("test_replayer_nondeterministic_history.json")
220+
.open("r") as f
221+
):
216222
history_json_bad = f.read()
217223

218224
callcount = 0
@@ -389,9 +395,11 @@ async def test_replayer_command_reordering_backward_compatibility() -> None:
389395
to [UpdateAccepted, CompleteWorkflowExecution], and events 5 and 6 can be applied to the
390396
corresponding state machines.
391397
"""
392-
with Path(__file__).with_name(
393-
"test_replayer_command_reordering_backward_compatibility.json"
394-
).open() as f:
398+
with (
399+
Path(__file__)
400+
.with_name("test_replayer_command_reordering_backward_compatibility.json")
401+
.open() as f
402+
):
395403
history = f.read()
396404
await Replayer(workflows=[UpdateCompletionAfterWorkflowReturn]).replay_workflow(
397405
WorkflowHistory.from_json("fake", history)
@@ -475,9 +483,11 @@ async def test_replayer_async_ordering() -> None:
475483

476484

477485
async def test_replayer_alternate_async_ordering() -> None:
478-
with Path(__file__).with_name(
479-
"test_replayer_event_tracing_alternate.json"
480-
).open() as f:
486+
with (
487+
Path(__file__)
488+
.with_name("test_replayer_event_tracing_alternate.json")
489+
.open() as f
490+
):
481491
history = f.read()
482492
await Replayer(
483493
workflows=[ActivityAndSignalsWhileWorkflowDown],

0 commit comments

Comments
 (0)