From 6608555b4c83e29363e9178ce5faba7b2d0050ce Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 18 Apr 2026 11:54:36 +0000 Subject: [PATCH 1/3] fix(docker): align SPACY_MODEL_NAMES with spaCy 3.8 available pipelines Use zh_core_web_sm (zh has no *_news_sm). Drop ta, te, th, tr, vi which have no trained pipeline packages for spaCy 3.8.x so docker build succeeds. Co-authored-by: Christian --- src/constants/spacy_models.py | 7 +------ tests/test_spacy_fixes_verification.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/constants/spacy_models.py b/src/constants/spacy_models.py index 114bdd7..de1c683 100644 --- a/src/constants/spacy_models.py +++ b/src/constants/spacy_models.py @@ -7,22 +7,17 @@ "nl": "nl_core_news_sm", "pt": "pt_core_news_sm", "ru": "ru_core_news_sm", - "zh": "zh_core_news_sm", + "zh": "zh_core_web_sm", "ja": "ja_core_news_sm", "ko": "ko_core_news_sm", "ar": "ar_core_news_sm", "hi": "hi_core_news_sm", "bn": "bn_core_news_sm", "pa": "pa_core_news_sm", - "ta": "ta_core_news_sm", - "te": "te_core_news_sm", "ml": "ml_core_news_sm", - "tr": "tr_core_news_sm", - "vi": "vi_core_news_sm", "id": "id_core_news_sm", "ms": "ms_core_news_sm", "fil": "fil_core_news_sm", - "th": "th_core_news_sm", "lo": "lo_core_news_sm", "my": "my_core_news_sm", "km": "km_core_news_sm", diff --git a/tests/test_spacy_fixes_verification.py b/tests/test_spacy_fixes_verification.py index ef9cbc8..b5585d1 100644 --- a/tests/test_spacy_fixes_verification.py +++ b/tests/test_spacy_fixes_verification.py @@ -42,6 +42,17 @@ def test_builder_installs_models_via_spacy_model_names(self): self.assertIn("spacy download", dockerfile) self.assertIn("src.constants.spacy_models", dockerfile) + def test_chinese_uses_web_pipeline_name(self): + from src.constants.spacy_models import SPACY_MODEL_NAMES + + self.assertEqual(SPACY_MODEL_NAMES["zh"], "zh_core_web_sm") + + def test_no_languages_without_spacy_3_8_pipelines(self): + from src.constants.spacy_models import SPACY_MODEL_NAMES + + for code in ("ta", "te", "th", "tr", "vi"): + self.assertNotIn(code, SPACY_MODEL_NAMES) + class TestFastAPIRedirectSlashes(unittest.TestCase): def test_app_disables_trailing_slash_redirect(self): From b3aa9d8d37a1a38d8e0011ce56c36bcc18226898 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 18 Apr 2026 12:19:20 +0000 Subject: [PATCH 2/3] ci: add container build workflow for main and development - Trigger on main and development so Docker builds pick up fixes before merge - development pushes ghcr tags :development and :vVERSION-development (not :latest) - Replace poetry lock with poetry check --lock for reproducible CI Co-authored-by: Christian --- .github/workflows/build-container.yaml | 85 ++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .github/workflows/build-container.yaml diff --git a/.github/workflows/build-container.yaml b/.github/workflows/build-container.yaml new file mode 100644 index 0000000..ff22a76 --- /dev/null +++ b/.github/workflows/build-container.yaml @@ -0,0 +1,85 @@ +name: Build and Push Container + +on: + push: + branches: + - main + - development + +jobs: + build-and-push: + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install Poetry + run: pip install poetry==2.1.3 + + - name: Verify lockfile matches pyproject.toml + run: poetry check --lock + + - name: Get version + id: version + run: echo "VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')" >> $GITHUB_OUTPUT + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Build and push Docker image (main) + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ghcr.io/lumen-labs/brainapi:v${{ steps.version.outputs.VERSION }} + ghcr.io/lumen-labs/brainapi:latest + build-args: | + BUILD_DATE=${{ github.event.head_commit.timestamp }} + BUILD_SHA=${{ github.sha }} + CACHE_BUST=${{ github.run_number }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Build and push Docker image (development) + if: github.ref == 'refs/heads/development' + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + push: true + tags: | + ghcr.io/lumen-labs/brainapi:development + ghcr.io/lumen-labs/brainapi:v${{ steps.version.outputs.VERSION }}-development + build-args: | + BUILD_DATE=${{ github.event.head_commit.timestamp }} + BUILD_SHA=${{ github.sha }} + CACHE_BUST=${{ github.run_number }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Create Git tag (only on main branch) + if: github.ref == 'refs/heads/main' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git tag -a v${{ steps.version.outputs.VERSION }} -m "Release v${{ steps.version.outputs.VERSION }}" + git push origin v${{ steps.version.outputs.VERSION }} From 2c33bdd0ce1e37147d21de2aad0f51bcbf00f5d6 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 18 Apr 2026 14:21:30 +0200 Subject: [PATCH 3/3] bump version 2.11.6-dev --- README.md | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dbdfd7d..52e3a32 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

Discord - Version + Version Python License

diff --git a/pyproject.toml b/pyproject.toml index efc8973..2e88b16 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "brainapi2" -version = "2.11.5-dev" +version = "2.11.6-dev" description = "Version 2.x.x of the BrainAPI memory layer." authors = [ {name = "Christian",email = "alch.infoemail@gmail.com"}