Skip to content

Commit 1f62d1d

Browse files
committed
↗️ migrate poetry to rye
1 parent 8987cda commit 1f62d1d

27 files changed

+388
-4325
lines changed

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

dev-setup.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# AUTO DEV SETUP
2+
3+
# check if rye is installed
4+
if ! command -v rye &> /dev/null
5+
then
6+
echo "rye could not be found: installing now ..."
7+
curl -sSf https://rye-up.com/get | bash
8+
echo "Check the rye docs for more info: https://rye-up.com/"
9+
fi
10+
11+
echo "SYNC: setup .venv"
12+
rye sync
13+
14+
echo "ACTIVATE: activate .venv"
15+
rye shell
16+
17+
echo "SETUP: install pre-commit hooks"
18+
pre-commit install
19+
20+
echo "TESTING ..."
21+
pytest

poetry.lock

-4,243
This file was deleted.

pyproject.toml

+76-37
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,84 @@
1-
[tool.poetry]
1+
[project]
22
name = "codeinterpreterapi"
33
version = "0.0.14"
4-
authors = ["Shroominic <[email protected]>"]
5-
license = "MIT"
64
description = "CodeInterpreterAPI is an (unofficial) open source python interface for the ChatGPT CodeInterpreter."
7-
keywords = ["codeinterpreter", "chatgpt", "codeinterpreterapi", "api", "langchain", "codeboxapi"]
5+
authors = [
6+
{ name = "Shroominic", email = "[email protected]" }
7+
]
8+
dependencies = [
9+
"openai",
10+
"langchain",
11+
"codeboxapi>=0.0.19",
12+
"python-dotenv",
13+
"pydantic>=2",
14+
"pydantic-settings>=2",
15+
]
16+
license = { file = "LICENSE" }
817
readme = "README.md"
9-
repository = "https://github.com/shroominic/codeinterpreter-api"
10-
11-
[tool.poetry.dependencies]
12-
python = ">=3.9.7,<4.0"
13-
langchain = ">=0.0.312"
14-
codeboxapi = ">=0.0.19"
15-
openai = "*"
16-
python-dotenv = "*"
17-
pydantic = "^2"
18-
pydantic-settings = "^2"
19-
mkdocs-material = ">=9.2.7"
20-
streamlit = { version = "^1", optional = true }
21-
jupyter-kernel-gateway = { version = "^2", optional = true }
22-
Pillow = { version = ">=9,<11", optional = true }
23-
24-
[tool.poetry.extras]
25-
all = ["jupyter-kernel-gateway", "streamlit", "Pillow"]
26-
localbox = ["jupyter-kernel-gateway"]
27-
frontend = ["streamlit"]
28-
image_support = ["Pillow"]
29-
30-
[tool.poetry.group.dev]
31-
optional = true
18+
requires-python = ">= 3.9.7, <3.12"
19+
keywords = ["codeinterpreter", "chatgpt", "codeinterpreterapi", "api", "langchain", "codeboxapi"]
20+
classifiers = [
21+
"License :: OSI Approved :: MIT License",
22+
"Programming Language :: Python :: 3.9",
23+
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
26+
]
27+
28+
[project.urls]
29+
Code = "https://github.com/shroominic/codeinterpreter-api"
30+
Docs = "https://shroominic.github.io/codeinterpreter-api"
31+
32+
[build-system]
33+
requires = ["hatchling"]
34+
build-backend = "hatchling.build"
35+
36+
[tool.rye]
37+
managed = true
38+
dev-dependencies = [
39+
"ruff",
40+
"mypy",
41+
"isort",
42+
"pytest",
43+
"ipython",
44+
"pre-commit",
45+
"codeinterpreterapi[all]",
46+
"mkdocs-material>=9.4",
47+
]
48+
49+
[project.optional-dependencies]
50+
localbox = [
51+
"jupyter-kernel-gateway",
52+
]
53+
frontend = [
54+
"streamlit",
55+
]
56+
image_support = [
57+
"Pillow",
58+
]
59+
all = [
60+
"jupyter-kernel-gateway",
61+
"streamlit",
62+
"Pillow",
63+
]
64+
65+
[tool.hatch.metadata]
66+
allow-direct-references = true
3267

3368
[tool.pytest.ini_options]
34-
filterwarnings = "ignore::DeprecationWarning"
69+
addopts = "-p no:warnings"
3570

36-
[tool.poetry.group.dev.dependencies]
37-
pytest = ">=7.3"
38-
mypy = ">=1.4"
39-
black = "^23"
40-
flake8 = "^6"
41-
pre-commit = ">=3.3"
71+
[tool.isort]
72+
multi_line_output = 3
73+
include_trailing_comma = true
74+
force_grid_wrap = 0
75+
line_length = 120
4276

43-
[build-system]
44-
requires = ["poetry-core>=1.0.0"]
45-
build-backend = "poetry.core.masonry.api"
77+
[tool.flake8]
78+
max-line-length = 120
79+
80+
[tool.mypy]
81+
ignore_missing_imports = true
82+
disallow_untyped_defs = true
83+
disallow_untyped_calls = true
84+
disallow_incomplete_defs = true

requirements-dev.lock

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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+
9+
-e file:.
10+
aiohttp==3.9.1
11+
aiosignal==1.3.1
12+
altair==5.2.0
13+
annotated-types==0.6.0
14+
anyio==4.1.0
15+
appnope==0.1.3
16+
argon2-cffi==23.1.0
17+
argon2-cffi-bindings==21.2.0
18+
arrow==1.3.0
19+
asttokens==2.4.1
20+
attrs==23.1.0
21+
babel==2.13.1
22+
beautifulsoup4==4.12.2
23+
bleach==6.1.0
24+
blinker==1.7.0
25+
cachetools==5.3.2
26+
certifi==2023.11.17
27+
cffi==1.16.0
28+
cfgv==3.4.0
29+
charset-normalizer==3.3.2
30+
click==8.1.7
31+
codeboxapi==0.0.19
32+
colorama==0.4.6
33+
comm==0.2.0
34+
dataclasses-json==0.6.3
35+
debugpy==1.8.0
36+
decorator==5.1.1
37+
defusedxml==0.7.1
38+
distlib==0.3.8
39+
distro==1.8.0
40+
entrypoints==0.4
41+
executing==2.0.1
42+
fastjsonschema==2.19.0
43+
filelock==3.13.1
44+
fqdn==1.5.1
45+
frozenlist==1.4.0
46+
ghp-import==2.1.0
47+
gitdb==4.0.11
48+
gitpython==3.1.40
49+
h11==0.14.0
50+
httpcore==1.0.2
51+
httpx==0.25.2
52+
identify==2.5.33
53+
idna==3.6
54+
importlib-metadata==6.11.0
55+
iniconfig==2.0.0
56+
ipykernel==6.27.1
57+
ipython==8.18.1
58+
ipython-genutils==0.2.0
59+
isoduration==20.11.0
60+
isort==5.13.1
61+
jedi==0.19.1
62+
jinja2==3.1.2
63+
jsonpatch==1.33
64+
jsonpointer==2.4
65+
jsonschema==4.20.0
66+
jsonschema-specifications==2023.11.2
67+
jupyter-client==7.4.9
68+
jupyter-core==5.5.0
69+
jupyter-events==0.9.0
70+
jupyter-kernel-gateway==2.5.2
71+
jupyter-server==2.12.1
72+
jupyter-server-terminals==0.5.0
73+
jupyterlab-pygments==0.3.0
74+
langchain==0.0.349
75+
langchain-community==0.0.1
76+
langchain-core==0.0.13
77+
langsmith==0.0.69
78+
markdown==3.5.1
79+
markdown-it-py==3.0.0
80+
markupsafe==2.1.3
81+
marshmallow==3.20.1
82+
matplotlib-inline==0.1.6
83+
mdurl==0.1.2
84+
mergedeep==1.3.4
85+
mistune==3.0.2
86+
mkdocs==1.5.3
87+
mkdocs-material==9.5.2
88+
mkdocs-material-extensions==1.3.1
89+
multidict==6.0.4
90+
mypy==1.7.1
91+
mypy-extensions==1.0.0
92+
nbclassic==1.0.0
93+
nbclient==0.9.0
94+
nbconvert==7.12.0
95+
nbformat==5.9.2
96+
nest-asyncio==1.5.8
97+
nodeenv==1.8.0
98+
notebook==6.5.6
99+
notebook-shim==0.2.3
100+
numpy==1.26.2
101+
openai==1.3.8
102+
overrides==7.4.0
103+
packaging==23.2
104+
paginate==0.5.6
105+
pandas==2.1.4
106+
pandocfilters==1.5.0
107+
parso==0.8.3
108+
pathspec==0.12.1
109+
pexpect==4.9.0
110+
pillow==10.1.0
111+
platformdirs==4.1.0
112+
pluggy==1.3.0
113+
pre-commit==3.6.0
114+
prometheus-client==0.19.0
115+
prompt-toolkit==3.0.41
116+
protobuf==4.25.1
117+
psutil==5.9.6
118+
ptyprocess==0.7.0
119+
pure-eval==0.2.2
120+
pyarrow==14.0.1
121+
pycparser==2.21
122+
pydantic==2.5.2
123+
pydantic-core==2.14.5
124+
pydantic-settings==2.1.0
125+
pydeck==0.8.1b0
126+
pygments==2.17.2
127+
pymdown-extensions==10.5
128+
pytest==7.4.3
129+
python-dateutil==2.8.2
130+
python-dotenv==1.0.0
131+
python-json-logger==2.0.7
132+
pytz==2023.3.post1
133+
pyyaml==6.0.1
134+
pyyaml-env-tag==0.1
135+
pyzmq==24.0.1
136+
referencing==0.32.0
137+
regex==2023.10.3
138+
requests==2.31.0
139+
rfc3339-validator==0.1.4
140+
rfc3986-validator==0.1.1
141+
rich==13.7.0
142+
rpds-py==0.13.2
143+
ruff==0.1.7
144+
send2trash==1.8.2
145+
six==1.16.0
146+
smmap==5.0.1
147+
sniffio==1.3.0
148+
soupsieve==2.5
149+
sqlalchemy==2.0.23
150+
stack-data==0.6.3
151+
streamlit==1.29.0
152+
tenacity==8.2.3
153+
terminado==0.18.0
154+
tinycss2==1.2.1
155+
toml==0.10.2
156+
toolz==0.12.0
157+
tornado==6.4
158+
tqdm==4.66.1
159+
traitlets==5.14.0
160+
types-python-dateutil==2.8.19.14
161+
typing-extensions==4.9.0
162+
typing-inspect==0.9.0
163+
tzdata==2023.3
164+
tzlocal==5.2
165+
uri-template==1.3.0
166+
urllib3==2.1.0
167+
validators==0.22.0
168+
virtualenv==20.25.0
169+
watchdog==3.0.0
170+
wcwidth==0.2.12
171+
webcolors==1.13
172+
webencodings==0.5.1
173+
websocket-client==1.7.0
174+
websockets==11.0.3
175+
yarl==1.9.4
176+
zipp==3.17.0
177+
# The following packages are considered to be unsafe in a requirements file:
178+
setuptools==69.0.2

requirements.lock

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
9+
-e file:.
10+
aiohttp==3.9.1
11+
aiosignal==1.3.1
12+
annotated-types==0.6.0
13+
anyio==4.1.0
14+
attrs==23.1.0
15+
certifi==2023.11.17
16+
charset-normalizer==3.3.2
17+
codeboxapi==0.0.19
18+
dataclasses-json==0.6.3
19+
distro==1.8.0
20+
frozenlist==1.4.0
21+
h11==0.14.0
22+
httpcore==1.0.2
23+
httpx==0.25.2
24+
idna==3.6
25+
jsonpatch==1.33
26+
jsonpointer==2.4
27+
langchain==0.0.349
28+
langchain-community==0.0.1
29+
langchain-core==0.0.13
30+
langsmith==0.0.69
31+
marshmallow==3.20.1
32+
multidict==6.0.4
33+
mypy-extensions==1.0.0
34+
numpy==1.26.2
35+
openai==1.3.8
36+
packaging==23.2
37+
pydantic==2.5.2
38+
pydantic-core==2.14.5
39+
pydantic-settings==2.1.0
40+
python-dotenv==1.0.0
41+
pyyaml==6.0.1
42+
requests==2.31.0
43+
sniffio==1.3.0
44+
sqlalchemy==2.0.23
45+
tenacity==8.2.3
46+
tqdm==4.66.1
47+
typing-extensions==4.9.0
48+
typing-inspect==0.9.0
49+
urllib3==2.1.0
50+
websockets==11.0.3
51+
yarl==1.9.4
File renamed without changes.

codeinterpreterapi/agents/functions_agent.py renamed to src/codeinterpreterapi/agents/functions_agent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ def _parse_ai_message(message: BaseMessage) -> Union[AgentAction, AgentFinish]:
9595
)
9696

9797
return AgentFinish(
98-
return_values={"output": message.content}, log=message.content
98+
return_values={"output": message.content}, log=message.content # type: ignore
9999
)
100100

101-
def parse_result(self, result: List[Generation]) -> Union[AgentAction, AgentFinish]:
101+
def parse_result(self, result: List[Generation]) -> Union[AgentAction, AgentFinish]: # type: ignore
102102
if not isinstance(result[0], ChatGeneration):
103103
raise ValueError("This output parser only works on ChatGeneration output")
104104
message = result[0].message

0 commit comments

Comments
 (0)