File tree 13 files changed +173
-162
lines changed
13 files changed +173
-162
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,10 @@ jobs:
28
28
shell : bash
29
29
30
30
steps :
31
- - uses : actions/checkout@v3
32
- - uses : actions /setup-python@v3
31
+ - uses : actions/checkout@v4
32
+ - uses : eifinger /setup-rye@v2
33
33
with :
34
- python-version : ${{ matrix.python-version }}
35
- cache : " pip"
34
+ enable-cache : true
36
35
37
36
- name : Setup
38
37
run : ./script/setup
Original file line number Diff line number Diff line change
1
+ 3.12.2
Original file line number Diff line number Diff line change @@ -16,20 +16,22 @@ dependencies = [
16
16
" pydantic>1.10.7" ,
17
17
" typing_extensions>=4.5.0" ,
18
18
]
19
- optional-dependencies = { dev = [
20
- " pylint" ,
21
- " pyright" ,
22
- " pytest" ,
23
- " pytest-asyncio" ,
24
- " pytest-recording" ,
25
- " respx" ,
26
- " ruff>=0.3.3" ,
27
- ] }
28
19
29
20
[project .urls ]
30
21
homepage = " https://replicate.com"
31
22
repository = " https://github.com/replicate/replicate-python"
32
23
24
+ [tool ]
25
+ rye = { dev-dependencies = [
26
+ " pytest>=8.1.1" ,
27
+ " pylint>=3.1.0" ,
28
+ " pyright>=1.1.358" ,
29
+ " pytest-asyncio>=0.23.6" ,
30
+ " pytest-recording>=0.13.1" ,
31
+ " respx>=0.21.1" ,
32
+ " ruff>=0.3.7" ,
33
+ ] }
34
+
33
35
[tool .pytest .ini_options ]
34
36
testpaths = " tests/"
35
37
Original file line number Diff line number Diff line change 1
1
from importlib .metadata import version
2
2
3
- __version__ = version (__package__ )
3
+ __version__ = version (__package__ if __package__ is not None else "replicate" )
Original file line number Diff line number Diff line change @@ -253,8 +253,7 @@ def output_iterator(self) -> Iterator[Any]:
253
253
254
254
output = self .output or []
255
255
new_output = output [len (previous_output ) :]
256
- for output in new_output :
257
- yield output
256
+ yield from new_output
258
257
259
258
async def async_output_iterator (self ) -> AsyncIterator [Any ]:
260
259
"""
Original file line number Diff line number Diff line change
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+
10
+ -e file:.
11
+ annotated-types==0.6.0
12
+ # via pydantic
13
+ anyio==4.3.0
14
+ # via httpx
15
+ astroid==3.1.0
16
+ # via pylint
17
+ certifi==2024.2.2
18
+ # via httpcore
19
+ # via httpx
20
+ dill==0.3.8
21
+ # via pylint
22
+ h11==0.14.0
23
+ # via httpcore
24
+ httpcore==1.0.5
25
+ # via httpx
26
+ httpx==0.27.0
27
+ # via replicate
28
+ # via respx
29
+ idna==3.7
30
+ # via anyio
31
+ # via httpx
32
+ # via yarl
33
+ iniconfig==2.0.0
34
+ # via pytest
35
+ isort==5.13.2
36
+ # via pylint
37
+ mccabe==0.7.0
38
+ # via pylint
39
+ multidict==6.0.5
40
+ # via yarl
41
+ nodeenv==1.8.0
42
+ # via pyright
43
+ packaging==24.0
44
+ # via pytest
45
+ # via replicate
46
+ platformdirs==4.2.0
47
+ # via pylint
48
+ pluggy==1.4.0
49
+ # via pytest
50
+ pydantic==2.7.0
51
+ # via replicate
52
+ pydantic-core==2.18.1
53
+ # via pydantic
54
+ pylint==3.1.0
55
+ pyright==1.1.358
56
+ pytest==8.1.1
57
+ # via pytest-asyncio
58
+ # via pytest-recording
59
+ pytest-asyncio==0.23.6
60
+ pytest-recording==0.13.1
61
+ pyyaml==6.0.1
62
+ # via vcrpy
63
+ respx==0.21.1
64
+ ruff==0.3.7
65
+ setuptools==69.2.0
66
+ # via nodeenv
67
+ sniffio==1.3.1
68
+ # via anyio
69
+ # via httpx
70
+ tomlkit==0.12.4
71
+ # via pylint
72
+ typing-extensions==4.11.0
73
+ # via pydantic
74
+ # via pydantic-core
75
+ # via replicate
76
+ vcrpy==6.0.1
77
+ # via pytest-recording
78
+ wrapt==1.16.0
79
+ # via vcrpy
80
+ yarl==1.9.4
81
+ # via vcrpy
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ # generated by rye
2
+ # use `rye lock` or `rye sync` to update this lockfile
3
+ #
4
+ # last locked with the following flags:
5
+ # pre: false
6
+ # features: []
7
+ # all-features: false
8
+ # with-sources: false
9
+
10
+ -e file:.
11
+ annotated-types==0.6.0
12
+ # via pydantic
13
+ anyio==4.3.0
14
+ # via httpx
15
+ certifi==2024.2.2
16
+ # via httpcore
17
+ # via httpx
18
+ h11==0.14.0
19
+ # via httpcore
20
+ httpcore==1.0.5
21
+ # via httpx
22
+ httpx==0.27.0
23
+ # via replicate
24
+ idna==3.7
25
+ # via anyio
26
+ # via httpx
27
+ packaging==24.0
28
+ # via replicate
29
+ pydantic==2.7.0
30
+ # via replicate
31
+ pydantic-core==2.18.1
32
+ # via pydantic
33
+ sniffio==1.3.1
34
+ # via anyio
35
+ # via httpx
36
+ typing-extensions==4.11.0
37
+ # via pydantic
38
+ # via pydantic-core
39
+ # via replicate
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/sh
2
2
3
3
set -e
4
4
5
- python -m ruff format .
5
+ exec rye fmt .
Original file line number Diff line number Diff line change 5
5
STATUS=0
6
6
7
7
echo " Running pyright"
8
- python -m pyright replicate || STATUS=$?
8
+ rye run pyright replicate || STATUS=$?
9
9
echo " "
10
10
11
11
echo " Running pylint"
12
- python -m pylint --exit-zero replicate || STATUS=$?
12
+ rye run pylint --exit-zero replicate || STATUS=$?
13
13
echo " "
14
14
15
- echo " Running ruff check "
16
- python -m ruff check . || STATUS=$?
15
+ echo " Running rye lint "
16
+ rye lint . || STATUS=$?
17
17
echo " "
18
18
19
- echo " Running ruff format check"
20
- python -m ruff format --check . || STATUS=$?
19
+ echo " Running rye fmt -- check"
20
+ rye fmt --check || STATUS=$?
21
21
echo " "
22
22
23
23
exit $STATUS
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/sh
2
2
3
- set -e
3
+ set -eu
4
4
5
- python -m pip install -r requirements.txt -r requirements-dev.txt .
5
+ : " ${RYE_INSTALL_OPTION:= ' --yes' } "
6
+ : " ${RYE_VERSION:= ' latest' } "
7
+
8
+ if ! command -v rye > /dev/null 2>&1
9
+ then
10
+ echo " rye is not installed."
11
+ printf " Do you want to install rye? (y/n) "
12
+ read -r REPLY
13
+ echo # move to a new line
14
+ case " $REPLY " in
15
+ [yY])
16
+ echo " Installing rye..."
17
+ curl -sSf https://rye-up.com/get | sh
18
+ echo " rye has been successfully installed."
19
+ ;;
20
+ * )
21
+ exit 1
22
+ ;;
23
+ esac
24
+ else
25
+ echo " rye is already installed."
26
+ fi
27
+
28
+ exec rye sync
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/sh
2
2
3
3
set -e
4
4
5
- python -m pytest -v
5
+ exec rye test -v
You can’t perform that action at this time.
0 commit comments