From 10fee97902fe37cbbd46f6d18661f4800f5ea62f Mon Sep 17 00:00:00 2001 From: Aymeric Date: Mon, 6 Jan 2025 21:05:41 +0100 Subject: [PATCH] Update test workflows --- .github/workflows/quality.yml | 22 ++++++++++++++++------ .github/workflows/trufflehog.yml | 18 ++++++++++++++++++ docs/source/en/guided_tour.md | 3 ++- src/smolagents/agents.py | 3 --- tests/test_python_interpreter.py | 1 - 5 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/trufflehog.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 2286e03..96b8f3a 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -5,19 +5,29 @@ on: [pull_request] jobs: quality: runs-on: ubuntu-latest + env: + UV_HTTP_TIMEOUT: 600 # max 10min to install deps + steps: - - uses: actions/checkout@v3.1.0 - - name: Set up Python 3.9 - uses: actions/setup-python@v3 + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 with: python-version: 3.10 - cache: 'pip' - cache-dependency-path: 'setup.py' + - name: Install Python dependencies run: pip install -e .[quality] + - name: Run Quality check run: make quality - name: Check if failure if: ${{ failure() }} run: | - echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and rerun 'make style; make quality;'" >> $GITHUB_STEP_SUMMARY \ No newline at end of file + echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and rerun 'make style; make quality;'" >> $GITHUB_STEP_SUMMARY + + - name: Run Style check + run: make style + - name: Check if failure + if: ${{ failure() }} + run: | + echo "Style check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and rerun 'make style; make quality;'" >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/.github/workflows/trufflehog.yml b/.github/workflows/trufflehog.yml new file mode 100644 index 0000000..4e43c10 --- /dev/null +++ b/.github/workflows/trufflehog.yml @@ -0,0 +1,18 @@ +on: + push: + +name: Secret Leaks + +permissions: + contents: read + +jobs: + trufflehog: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Secret Scanning + uses: trufflesecurity/trufflehog@main \ No newline at end of file diff --git a/docs/source/en/guided_tour.md b/docs/source/en/guided_tour.md index 265d33f..4e2fe44 100644 --- a/docs/source/en/guided_tour.md +++ b/docs/source/en/guided_tour.md @@ -284,7 +284,8 @@ Out - Final answer: ByteDance/AnimateDiff-Lightning Out[20]: 'ByteDance/AnimateDiff-Lightning' ``` -Read more on tools in the [dedicated tutorial](./tutorials/tools#what-is-a-tool-and-how-to-build-one) +> [!TIP] +> Read more on tools in the [dedicated tutorial](./tutorials/tools#what-is-a-tool-and-how-to-build-one). ## Multi-agents diff --git a/src/smolagents/agents.py b/src/smolagents/agents.py index a8ee83e..ab21b7c 100644 --- a/src/smolagents/agents.py +++ b/src/smolagents/agents.py @@ -136,7 +136,6 @@ def format_prompt_with_managed_agents_descriptions( if agent_descriptions_placeholder is None: agent_descriptions_placeholder = "{{managed_agents_descriptions}}" if agent_descriptions_placeholder not in prompt_template: - print("PROMPT TEMPLLL", prompt_template) raise ValueError( f"Provided prompt template does not contain the managed agents descriptions placeholder '{agent_descriptions_placeholder}'" ) @@ -964,8 +963,6 @@ class CodeAgent(MultiStepAgent): console.print( "[bold red]Code execution failed due to an unauthorized import. Consider passing said import under additional_authorized_imports when initializing your CodeAgent." ) - else: - console.print("PLACEHOLDER" + str(e)) raise AgentExecutionError(error_msg) truncated_output = truncate_content(str(output)) diff --git a/tests/test_python_interpreter.py b/tests/test_python_interpreter.py index 03e3075..de044c5 100644 --- a/tests/test_python_interpreter.py +++ b/tests/test_python_interpreter.py @@ -838,7 +838,6 @@ parts_with_5_set_count[['Quantity', 'SetCount']].values[1] import pandas as pd df = pd.DataFrame.from_dict({"AtomicNumber": [111, 104, 105], "ok": [0, 1, 2]}) -print("HH0") # Filter the DataFrame to get only the rows with outdated atomic numbers filtered_df = df.loc[df['AtomicNumber'].isin([104])]