Make some dependencies optional
Hey, first of all thanks for your wonderful project!
I've noticed that the default setup of Aider is at 926 MB now. This is mostly due to dependencies. Here's top 15:
124M pyarrow
107M playwright
103M scipy
90M pandas
85M tree_sitter_languages
74M googleapiclient
33M numpy
27M streamlit
27M numpy.libs
24M litellm
23M scipy.libs
16M networkx
15M pydeck
15M google
13M grpc
The way around that is to make some dependencies optional. One low-hanging fruit is Streamlit, which is 484 MB (incluing its own dependencies)! To do that, you could declare it as an extra:
setup(
name="aider",
...,
extras_require={
"browser": ["streamlit", "pyarrow", "pandas", ...],
},
)
And check if it's available in the runtime:
def launch_gui(args):
from aider import gui
try:
from streamlit.web import cli
except ModuleNotFoundError:
print(
"Aider was installed without web support. To add it, run:\n"
" pip install aider-chat[browser]"
)
sys.exit(1)
Please let me know if you would be interested in a PR!
(Another option, of course, would be to replace Streamlit with something lighter, but I'm not sure if it's feasible at this point.)
As of v0.44.0:
- Default pip install size reduced by 3-12x.
- Added 3 package extras, which aider will offer to install when needed:
aider-chat[help]aider-chat[browser]aider-chat[playwright]
I'm going to close this issue for now, but feel free to add a comment here and I will re-open or file a new issue any time.