From d9571d22c7a36aa5853329bf9d10cc15ab7481b8 Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Tue, 22 Jul 2025 21:28:15 -0700 Subject: [PATCH] show next and previous pages docs --- .github/PULL_REQUEST_TEMPLATE.md | 6 +- .github/workflows/autofix.yml | 25 -- .github/workflows/bearer.yml | 43 ---- .github/workflows/comprehensive_tests.yml | 89 ------- .github/workflows/docker-publish.yml | 2 +- .github/workflows/lint.yml | 10 +- .github/workflows/test.yml | 60 ----- .github/workflows/tests.yml | 10 +- docs/mkdocs.yml | 2 + docs/overrides/main.html | 281 ++++++++++++++++++++++ 10 files changed, 297 insertions(+), 231 deletions(-) delete mode 100644 .github/workflows/autofix.yml delete mode 100644 .github/workflows/bearer.yml delete mode 100644 .github/workflows/comprehensive_tests.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7dc861aa..45aee650 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ Thank you for contributing to Swarms! Replace this comment with: - - Description: a description of the change, + - Description: a description of the change, - Issue: the issue # it fixes (if applicable), - Dependencies: any dependencies required for this change, - Tag maintainer: for a quicker response, tag the relevant maintainer (see below), @@ -9,7 +9,7 @@ Replace this comment with: Please make sure your PR is passing linting and testing before submitting. Run `make format`, `make lint` and `make test` to check this locally. -See contribution guidelines for more information on how to write/run tests, lint, etc: +See contribution guidelines for more information on how to write/run tests, lint, etc: https://github.com/kyegomez/swarms/blob/master/CONTRIBUTING.md If you're adding a new integration, please include: @@ -26,4 +26,4 @@ Maintainer responsibilities: If no one reviews your PR within a few days, feel free to email Kye at kye@apac.ai -See contribution guidelines for more information on how to write/run tests, lint, etc: https://github.com/kyegomez/swarms \ No newline at end of file +See contribution guidelines for more information on how to write/run tests, lint, etc: https://github.com/kyegomez/swarms diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml deleted file mode 100644 index b2163500..00000000 --- a/.github/workflows/autofix.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: autofix.ci - -on: - pull_request: - push: - branches: ["main"] -permissions: - contents: read - -jobs: - autofix: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-go@v5 - - run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest - - run: yamlfmt . - - - uses: actions/setup-python@v5 - - run: pip install ruff - - run: ruff format . - - run: ruff check --fix . - - - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 diff --git a/.github/workflows/bearer.yml b/.github/workflows/bearer.yml deleted file mode 100644 index be0fb591..00000000 --- a/.github/workflows/bearer.yml +++ /dev/null @@ -1,43 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# -# This workflow file requires a free account on Bearer.com to manage findings, notifications and more. -# See https://docs.bearer.com/guides/bearer-cloud/ -name: Bearer - -on: - push: - branches: ["master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: ["master"] - schedule: - - cron: '24 22 * * 6' - -permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - -jobs: - bearer: - runs-on: ubuntu-latest - steps: - # Checkout project source - - uses: actions/checkout@v4 - # Scan code using Bearer CLI - - name: Run Report - id: report - uses: bearer/bearer-action@828eeb928ce2f4a7ca5ed57fb8b59508cb8c79bc - with: - api-key: ${{ secrets.BEARER_TOKEN }} - format: sarif - output: results.sarif - exit-code: 0 - # Upload SARIF file generated in previous step - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif diff --git a/.github/workflows/comprehensive_tests.yml b/.github/workflows/comprehensive_tests.yml deleted file mode 100644 index 314ed6e9..00000000 --- a/.github/workflows/comprehensive_tests.yml +++ /dev/null @@ -1,89 +0,0 @@ -# .github/workflows/comprehensive_tests.yml - -name: Swarms Comprehensive Tests - -# This workflow triggers on pushes and pull requests to the master branch. -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - # You can test against multiple Python versions here if needed. - python-version: ["3.10"] - - steps: - # Step 1: Check out the code. - # For pull requests, this action automatically checks out the code - # from the PR's branch, not the master branch. This is the key - # to testing the proposed changes. - - name: Checkout repository - uses: actions/checkout@v4 - - # Step 2: Set up the specified Python version. - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - # Step 3: Install Poetry for dependency management. - - name: Install Poetry - uses: snok/install-poetry@v1 - with: - virtualenvs-create: true - virtualenvs-in-project: true - - # Step 4: Cache dependencies to speed up subsequent runs. - - name: Load cached venv - id: cached-poetry-dependencies - uses: actions/cache@v4 - with: - path: .venv - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - - # Step 5: Install dependencies and the project package itself. - # This is the crucial step. 'poetry install' will install all dependencies - # and also install the 'swarms' package from the checked-out PR code - # in editable mode within the virtual environment. - - name: Install dependencies - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - run: poetry install --no-interaction --with dev --all-extras - - # Step 6: Create dummy image files required for multi-modal tests. - # This ensures your tests are self-contained. - - name: Create dummy image files for testing - run: | - mkdir -p tests/test_data - touch tests/test_data/image1.jpg - touch tests/test_data/image2.png - echo "dummy image data" > tests/test_data/image1.jpg - echo "dummy image data" > tests/test_data/image2.png - - # Step 7: Run the comprehensive test suite. - # 'poetry run' executes the command within the virtual environment, - # ensuring that when 'tests/comprehensive_test.py' imports 'swarms', - # it's importing the code from the pull request. - - name: Run Comprehensive Test Suite - env: - # Securely pass API keys and other secrets to the test environment. - # These must be configured in your repository's secrets. - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # GITHUB_REPO_OWNER: "kyegomez" - # GITHUB_REPO_NAME: "swarms" - run: | - poetry run python tests/comprehensive_test.py - - # Step 8: Upload the generated test report as an artifact. - # This happens even if the previous steps fail, allowing you to debug. - - name: Upload Test Report - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-report-${{ matrix.python-version }} - path: test_runs/ \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2b1b1a0b..34372b3e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -70,4 +70,4 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dd720c15..964a012a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,12 +7,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.10' - + - name: Cache pip dependencies uses: actions/cache@v4 with: @@ -20,14 +20,14 @@ jobs: key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- - + - name: Install dependencies run: | python -m pip install --upgrade pip pip install black==24.2.0 ruff==0.2.1 - + - name: Check Black formatting run: black . --check --diff - + - name: Run Ruff linting run: ruff check . diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index d5e053d0..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Tests -on: - push: - schedule: - - cron: "0 0 * * *" -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Setup a local virtual environment - run: | - poetry config virtualenvs.create true --local - poetry config virtualenvs.in-project true --local - - uses: actions/cache@v4 - name: Define a cache for the virtual environment - file - with: - path: ./.venv - key: venv-${{ hashFiles('poetry.lock') }} - - name: Install the project dependencies - run: poetry install - - name: Install OpenCV - run: sudo apt-get install python3-opencv - - name: Enter the virtual environment - run: source $VENV - - name: Run the tests - run: poetry run pytest --verbose - run-examples: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v5 - - name: Install Poetry - uses: snok/install-poetry@v1 - - name: Setup a local virtual environment - run: | - poetry config virtualenvs.create true --local - poetry config virtualenvs.in-project true --local - - uses: actions/cache@v4 - name: Define a cache for the virtual environment - file - with: - path: ./.venv - key: venv-${{ hashFiles('poetry.lock') }} - - name: Install the project dependencies - run: poetry install - - name: Install OpenCV - run: sudo apt-get install python3-opencv - - name: Enter the virtual environment - run: source $VENV - - name: Make Script Executable and Run - run: |- - chmod +x ./scripts/run_examples.sh - ./scripts/run_examples.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6e16b0dc..fb6f4c5e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,20 +12,20 @@ jobs: steps: - uses: actions/checkout@v4 - + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: python-version: "3.10" - + - name: Install Poetry run: | curl -sSL https://install.python-poetry.org | python3 - - + - name: Install dependencies run: | poetry install --with test - + - name: Run tests run: | - poetry run pytest tests/ -v \ No newline at end of file + poetry run pytest tests/ -v diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 3417b57f..80970e09 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -152,6 +152,8 @@ theme: - navigation.sections # - navigation.expand - navigation.top + - navigation.footer + - navigation.path - announce.dismiss font: text: "Fira Sans" # Clean and readable text diff --git a/docs/overrides/main.html b/docs/overrides/main.html index c2828415..33c30d42 100644 --- a/docs/overrides/main.html +++ b/docs/overrides/main.html @@ -8,6 +8,41 @@ {% endblock %} +{% block content %} + {{ super() }} + +
+
+ {% if page.previous_page or page.next_page %} + + {% endif %} +
+
+{% endblock %} + {% block footer %}