From a1bfd011f28db9ca7bf86cb72e8cbeef17d4b2fe Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Fri, 16 May 2025 12:44:05 +0300 Subject: [PATCH 1/5] Try to manually release the documentation --- .github/workflows/update-docs.yaml | 79 ++++++++++++++++-------------- 1 file changed, 41 insertions(+), 38 deletions(-) diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml index d0413e6f..cdf9a70d 100644 --- a/.github/workflows/update-docs.yaml +++ b/.github/workflows/update-docs.yaml @@ -4,7 +4,10 @@ on: pull_request: types: [closed] paths: - - 'hirundo/__init__.py' + - "hirundo/__init__.py" + push: + branches: + - clnt-50-fix-docs # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -25,40 +28,40 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all history for all tags and branches - - uses: actions/setup-python@v3 - with: - python-version: "3.9" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m venv .venv - source .venv/bin/activate - pip install -r requirements/docs.txt - export VERSION_TAG=${{ github.event.pull_request.title }} - export VERSION=$(sed -e 's/^v//' <<< $VERSION_TAG) - pip install "hirundo==${VERSION}" - - name: Sphinx multi-version build - run: | - source .venv/bin/activate - git branch -a - git tag - git rev-parse --abbrev-ref HEAD - git rev-parse HEAD - sphinx-multiversion docs docs/_build/html - cp docs/_templates/github-pages-redirect.html docs/_build/html/index.html - env: - API_HOST: something - API_KEY: something - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: "docs/_build/html" - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all tags and branches + - uses: actions/setup-python@v3 + with: + python-version: "3.9" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m venv .venv + source .venv/bin/activate + pip install -r requirements/docs.txt + export VERSION_TAG=${{ (github.event_name == 'pull_request' && github.event.pull_request.title) || (github.event_name == 'push' && '0.1.16') }} + export VERSION=$(sed -e 's/^v//' <<< $VERSION_TAG) + pip install "hirundo==${VERSION}" + - name: Sphinx multi-version build + run: | + source .venv/bin/activate + git branch -a + git tag + git rev-parse --abbrev-ref HEAD + git rev-parse HEAD + sphinx-multiversion docs docs/_build/html + cp docs/_templates/github-pages-redirect.html docs/_build/html/index.html + env: + API_HOST: something + API_KEY: something + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: "docs/_build/html" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From 20254a549f864f0c5bfb185d73bb614691ed4a47 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Sun, 25 May 2025 17:31:14 +0300 Subject: [PATCH 2/5] Fix tests being unable to complete due to previous successful runs of the same datasets and the same run number --- .github/workflows/pytest-sanity.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pytest-sanity.yaml b/.github/workflows/pytest-sanity.yaml index a2787689..7561a196 100644 --- a/.github/workflows/pytest-sanity.yaml +++ b/.github/workflows/pytest-sanity.yaml @@ -50,7 +50,7 @@ jobs: AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} - UNIQUE_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_number }} + UNIQUE_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_number }}-${{ github.run_attempt }} FULL_TEST: ${{ (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9') && 'true' || 'false' }} - name: Run PyTest on Windows if: runner.os == 'Windows' @@ -62,5 +62,5 @@ jobs: AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} HUGGINGFACE_ACCESS_TOKEN: ${{ secrets.HUGGINGFACE_ACCESS_TOKEN }} - UNIQUE_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_number }} + UNIQUE_ID: ${{ matrix.os }}-${{ matrix.python-version }}-${{ github.run_number }}-${{ github.run_attempt }} FULL_TEST: false From 3090852b4afb0c165e1352f54df980a3f5151b68 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Wed, 11 Jun 2025 10:18:47 +0300 Subject: [PATCH 3/5] Fix bug found by bugbot (thank you Cursor) --- .github/workflows/update-docs.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml index cdf9a70d..7d0b23e8 100644 --- a/.github/workflows/update-docs.yaml +++ b/.github/workflows/update-docs.yaml @@ -41,8 +41,9 @@ jobs: python -m venv .venv source .venv/bin/activate pip install -r requirements/docs.txt - export VERSION_TAG=${{ (github.event_name == 'pull_request' && github.event.pull_request.title) || (github.event_name == 'push' && '0.1.16') }} - export VERSION=$(sed -e 's/^v//' <<< $VERSION_TAG) + # Extract version from hirundo/__init__.py + export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); print(re.search(r'__version__ = [\"\'](.*?)[\"\']', content).group(1))") + echo "Using version: $VERSION" pip install "hirundo==${VERSION}" - name: Sphinx multi-version build run: | From 4c3067f062313d0bda706c09e1d949dbb187df97 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Wed, 11 Jun 2025 11:03:39 +0300 Subject: [PATCH 4/5] Fix bug found by bugbot (thank you Cursor) --- .github/workflows/update-docs.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml index 7d0b23e8..25e8129d 100644 --- a/.github/workflows/update-docs.yaml +++ b/.github/workflows/update-docs.yaml @@ -42,8 +42,12 @@ jobs: source .venv/bin/activate pip install -r requirements/docs.txt # Extract version from hirundo/__init__.py - export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); print(re.search(r'__version__ = [\"\'](.*?)[\"\']', content).group(1))") + export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); match=re.search(r'__version__ = [\"\'](.*?)[\"\']', content); print(match.group(1) if match else 'unknown')") echo "Using version: $VERSION" + if [ "$VERSION" = "unknown" ]; then + echo "Error: Could not extract version from hirundo/__init__.py" + exit 1 + fi pip install "hirundo==${VERSION}" - name: Sphinx multi-version build run: | From d103b71a5a7d3d2879f7c45839ca4d3bc5b6bef1 Mon Sep 17 00:00:00 2001 From: Ben Lewis Date: Wed, 11 Jun 2025 11:23:26 +0300 Subject: [PATCH 5/5] Fix bug found by bugbot (thank you Cursor) --- .github/workflows/update-docs.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-docs.yaml b/.github/workflows/update-docs.yaml index 25e8129d..9a3e98cc 100644 --- a/.github/workflows/update-docs.yaml +++ b/.github/workflows/update-docs.yaml @@ -41,11 +41,15 @@ jobs: python -m venv .venv source .venv/bin/activate pip install -r requirements/docs.txt - # Extract version from hirundo/__init__.py - export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); match=re.search(r'__version__ = [\"\'](.*?)[\"\']', content); print(match.group(1) if match else 'unknown')") + # Extract version from hirundo/__init__.py with error handling + if [ -f "hirundo/__init__.py" ]; then + export VERSION=$(python -c "import re; content=open('hirundo/__init__.py').read(); match=re.search(r'__version__ = [\"\'](.*?)[\"\']', content); print(match.group(1) if match else 'unknown')" 2>/dev/null || echo 'unknown') + else + export VERSION='unknown' + fi echo "Using version: $VERSION" - if [ "$VERSION" = "unknown" ]; then - echo "Error: Could not extract version from hirundo/__init__.py" + if [ "$VERSION" = "unknown" ] || [ -z "$VERSION" ]; then + echo "Error: Could not extract version from hirundo/__init__.py (file may be missing, unreadable, or version format is invalid)" exit 1 fi pip install "hirundo==${VERSION}"