renamed hf-embed -> help

This commit is contained in:
Paul Gauthier 2024-07-16 10:58:49 +01:00
parent bd8143a880
commit b18dbf4772
8 changed files with 23 additions and 22 deletions

View file

@ -15,14 +15,14 @@ warnings.simplefilter("ignore", category=FutureWarning)
def install_help_extra(io):
pip_install_cmd = [
"aider-chat[hf-embed]",
"aider-chat[help]",
"--extra-index-url",
"https://download.pytorch.org/whl/cpu",
]
res = utils.check_pip_install_extra(
io,
"llama_index.embeddings.huggingface",
"To use interactive /help you need to install HuggingFace embeddings",
"To use interactive /help you need to install the help extras",
pip_install_cmd,
)
return res

View file

@ -9,7 +9,7 @@ COPY . /aider
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential git libportaudio2 && \
rm -rf /var/lib/apt/lists/* && \
pip install --no-cache-dir /aider[hf-embed] --extra-index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir /aider --extra-index-url https://download.pytorch.org/whl/cpu && \
rm -rf /aider
WORKDIR /app

View file

@ -4,5 +4,6 @@ addopts = -p no:warnings
testpaths =
tests/basic
tests/help
tests/browser

View file

@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --output-file=requirements/requirements-hf-embed.txt requirements/requirements-hf-embed.in
# pip-compile --output-file=requirements/requirements-help.txt requirements/requirements-help.in
#
aiohttp==3.9.5
# via
@ -109,10 +109,10 @@ llama-cloud==0.0.6
# via llama-index-core
llama-index-core==0.10.52.post2
# via
# -r requirements/requirements-hf-embed.in
# -r requirements/requirements-help.in
# llama-index-embeddings-huggingface
llama-index-embeddings-huggingface==0.2.2
# via -r requirements/requirements-hf-embed.in
# via -r requirements/requirements-help.in
markupsafe==2.1.5
# via
# -c requirements/../requirements.txt

View file

@ -8,7 +8,7 @@ pip-compile \
--output-file=requirements.txt \
$1
for SUFFIX in dev hf-embed browser playwright; do
for SUFFIX in dev help browser playwright; do
pip-compile \
requirements/requirements-${SUFFIX}.in \

View file

@ -33,7 +33,7 @@ packages += ["aider.website"]
print("Packages:", packages)
extras = "dev hf-embed browser playwright".split()
extras = "dev help browser playwright".split()
setup(
name="aider-chat",

View file

@ -1,31 +1,31 @@
import unittest
from unittest.mock import patch
import sys
import os
# Add the parent directory to the Python path
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from aider.main import main
class TestBrowser(unittest.TestCase):
@patch('aider.main.launch_gui')
@patch("aider.main.launch_gui")
def test_browser_flag_imports_streamlit(self, mock_launch_gui):
# Run main with --browser and --yes flags
main(['--browser', '--yes'])
main(["--browser", "--yes"])
# Check that launch_gui was called
mock_launch_gui.assert_called_once()
# Try to import streamlit
try:
import streamlit
import streamlit # noqa: F401
streamlit_imported = True
except ImportError:
streamlit_imported = False
# Assert that streamlit was successfully imported
self.assertTrue(streamlit_imported, "Streamlit should be importable after running with --browser flag")
self.assertTrue(
streamlit_imported, "Streamlit should be importable after running with --browser flag"
)
if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()