Skip to content

Commit ea0d70f

Browse files
committed
add support for 3.8 and 3.9
1 parent 41fdf5f commit ea0d70f

File tree

5 files changed

+42
-5
lines changed

5 files changed

+42
-5
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jobs:
1515
strategy:
1616
matrix:
1717
python-version: [
18+
3.8,
19+
3.9,
20+
3.10,
1821
3.11,
1922
3.12,
2023
3.13

pyproject.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name = "python-pyper"
99
dynamic = ["version"]
1010
description = "Concurrent Python made simple"
1111
readme = "README.md"
12-
requires-python = ">=3.10"
12+
requires-python = ">=3.8"
1313
authors = [
1414
{ name = "Richard Zhu", email = "[email protected]" },
1515
]
@@ -23,11 +23,17 @@ classifiers = [
2323
"Framework :: AsyncIO",
2424
"License :: OSI Approved :: MIT License",
2525
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.8",
27+
"Programming Language :: Python :: 3.9",
2628
"Programming Language :: Python :: 3.10",
2729
"Programming Language :: Python :: 3.11",
2830
"Programming Language :: Python :: 3.12",
2931
"Programming Language :: Python :: 3.13"
3032
]
33+
dependencies = [
34+
# Typing support dependency only for Python versions < 3.10
35+
"typing_extensions; python_version<'3.10'"
36+
]
3137

3238
[project.urls]
3339
Documentation = "https://pyper-dev.github.io/pyper/"

src/pyper/_core/decorators.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
from __future__ import annotations
22

33
import functools
4+
import sys
45
import typing as t
56

67
from .pipeline import AsyncPipeline, Pipeline
78
from .task import Task
89

10+
if sys.version_info < (3, 10): # pragma: no cover
11+
from typing_extensions import ParamSpec
12+
else:
13+
from typing import ParamSpec
914

10-
_P = t.ParamSpec('P')
15+
16+
_P = ParamSpec('P')
1117
_R = t.TypeVar('R')
1218
_ArgsKwargs: t.TypeAlias = t.Optional[t.Tuple[t.Tuple[t.Any], t.Dict[str, t.Any]]]
1319

src/pyper/_core/pipeline.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
from __future__ import annotations
22

33
import inspect
4+
import sys
45
import typing as t
56

67
from .async_helper.output import AsyncPipelineOutput
78
from .sync_helper.output import PipelineOutput
89

10+
if sys.version_info < (3, 10): # pragma: no cover
11+
from typing_extensions import ParamSpec
12+
else:
13+
from typing import ParamSpec
14+
915
if t.TYPE_CHECKING:
1016
from .task import Task
1117

1218

13-
_P = t.ParamSpec('P')
19+
_P = ParamSpec('P')
1420
_R = t.TypeVar('R')
15-
_P_Other = t.ParamSpec("P_Other")
21+
_P_Other = ParamSpec("P_Other")
1622
_R_Other = t.TypeVar("R_Other")
1723

1824

@@ -90,7 +96,7 @@ def __gt__(self, other: t.Callable[..., _R_Other]) -> t.Callable[_P, _R_Other]:
9096
return self.consume(other)
9197

9298
def __repr__(self):
93-
return f"{self.__class__.__name__} {[task.func for task in self.tasks]}"
99+
return f"<{self.__class__.__name__} {[task.func for task in self.tasks]}>"
94100

95101

96102
class AsyncPipeline(Pipeline[_P, _R]):

tests/docker-compose.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,19 @@ services:
3232
dockerfile: tests/Dockerfile
3333
args:
3434
PYTHON_VERSION: "3.10"
35+
36+
python3.9:
37+
container_name: test3.9
38+
build:
39+
context: ..
40+
dockerfile: tests/Dockerfile
41+
args:
42+
PYTHON_VERSION: "3.9"
43+
44+
python3.8:
45+
container_name: test3.8
46+
build:
47+
context: ..
48+
dockerfile: tests/Dockerfile
49+
args:
50+
PYTHON_VERSION: "3.8"

0 commit comments

Comments
 (0)