From 3e74751f2060ca75710aed40df042a66b660e0fe Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:13:04 +0000 Subject: [PATCH 1/9] Add Acknowledgements section with thanks to spaCy, Rich, Click, Python and contributors --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index abdb4b9..011f432 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,16 @@ We welcome contributions. Open a pull request (forking is optional) and referenc - Additional language pairs (e.g., ES, DE) - Plug‑in for remote LLM APIs +## Acknowledgements + +The Kaihou Engine stands on the shoulders of many great open‑source projects and the broader Python community: + +- **[spaCy](https://spacy.io/)** – the NLP library that provides the linguistic backbone. +- **[Rich](https://github.com/Textualize/rich)** – beautiful terminal rendering and colorised output. +- **[Click](https://palletsprojects.com/p/click/)** – the CLI framework that powers our command line. +- **[Python](https://www.python.org/)** – for its extensive ecosystem and thriving community. +- And countless **contributors** who have helped improve Kaihou Engine. + These items are tracked in the GitHub milestone **Future Features**. [![CI](https://github.com/kaihouproject/kaihou-engine/actions/workflows/ci.yml/badge.svg)](https://github.com/kaihouproject/kaihou-engine/actions/workflows/ci.yml) From 27d354282c7556f4f7e78e1d8610f78169fb6ebf Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:25:15 +0000 Subject: [PATCH 2/9] Improve CI/CD with pre-commit and add packaging metadata --- .github/workflows/ci.yml | 4 ++++ .pre-commit-config.yaml | 11 +++++++++++ pyproject.toml | 11 +++++++++++ 3 files changed, 26 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 217f802..f578d16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,5 +21,9 @@ jobs: run: | python -m pip install --upgrade pip setuptools wheel pip install -e ".[dev]" + # Install pre-commit + pip install pre-commit + # Run pre-commit on all files + pre-commit run --all-files - name: Run tests run: pytest -q diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a0be6d4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +repos: +- repo: https://github.com/psf/black + rev: 24.3.0 + hooks: + - id: black + language_version: python3.14 +- repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.6.2 + hooks: + - id: ruff + args: [--fix] diff --git a/pyproject.toml b/pyproject.toml index f3e3d74..83d48e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,17 @@ description = "Orchestration layer for Kaihou NLP Engine and related pipelines" readme = "README.md" authors = [{name = "Houtarou", email = "houtarou@example.com"}] license = {text = "MIT"} +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +urls = { + "Homepage" = "https://github.com/houtarou/kaihou-engine", + "Repository" = "https://github.com/houtarou/kaihou-engine", + "Documentation" = "https://github.com/houtarou/kaihou-engine#readme" +} requires-python = ">=3.11" dependencies = [ "click", From 9c41f4b8ae679ae17a4a0ea71c70f641fc8bfbe6 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:31:57 +0000 Subject: [PATCH 3/9] Fix TOML syntax for urls inline table --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 83d48e1..a3890f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,9 +16,9 @@ classifiers = [ "Operating System :: OS Independent", ] urls = { - "Homepage" = "https://github.com/houtarou/kaihou-engine", - "Repository" = "https://github.com/houtarou/kaihou-engine", - "Documentation" = "https://github.com/houtarou/kaihou-engine#readme" + Homepage = "https://github.com/houtarou/kaihou-engine", + Repository = "https://github.com/houtarou/kaihou-engine", + Documentation = "https://github.com/houtarou/kaihou-engine#readme" } requires-python = ">=3.11" dependencies = [ From 3aedee834892186949be26357f8b03c701e95726 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:33:12 +0000 Subject: [PATCH 4/9] Fix TOML syntax: convert urls to proper table --- pyproject.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a3890f7..487bbcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,11 +15,10 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -urls = { - Homepage = "https://github.com/houtarou/kaihou-engine", - Repository = "https://github.com/houtarou/kaihou-engine", - Documentation = "https://github.com/houtarou/kaihou-engine#readme" -} +[project.urls] +Homepage = "https://github.com/houtarou/kaihou-engine" +Repository = "https://github.com/houtarou/kaihou-engine" +Documentation = "https://github.com/houtarou/kaihou-engine#readme" requires-python = ">=3.11" dependencies = [ "click", From 63308bba52a39d2646d1c0d86059929a0d9bf709 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:35:05 +0000 Subject: [PATCH 5/9] Add alternative distribution methods section to README and release workflow to build wheels on tag --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ README.md | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f146bf0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release Build + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write # needed for creating a release + steps: + - uses: actions/checkout@v4 + with: + submodules: false + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + - name: Install build tools + run: | + python -m pip install --upgrade pip build + - name: Build wheels and sdist + run: | + python -m build --sdist --wheel + - name: Upload Release Assets + uses: softprops/action-gh-release@v2 + with: + files: dist/* + tag_name: ${{ github.ref_name }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 011f432..4fbba77 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,39 @@ Validation (numbers, entities, terminology, semantic similarity) ``` +## Installation + +## Alternative Distribution Methods + +You can install *Kaihou Engine* without publishing to PyPI using any of the following approaches: + +### 1. Direct install from GitHub (editable) +```bash +# Clone the repository (or just point pip to the URL) +python -m pip install -e git+https://github.com/kaihouproject/kaihou-engine.git@main#egg=kaihou-engine +``` +This installs the package in editable mode, so you can modify the source and the changes are reflected immediately. + +### 2. Install from a GitHub Release (wheel) +1. Create a release on GitHub (e.g., `v0.2.0`). The CI workflow will build a wheel and attach it as an asset. +2. Download the wheel asset and install it locally: +```bash +curl -L -o kaihou_engine-0.2.0-py3-none-any.whl \ + https://github.com/kaihouproject/kaihou-engine/releases/download/v0.2.0/kaihou_engine-0.2.0-py3-none-any.whl +python -m pip install kaihou_engine-0.2.0-py3-none-any.whl +``` + +### 3. Install from GitHub Packages (private or public registry) +If you enable GitHub Packages for the repository, you can publish the wheel there and install it with: +```bash +python -m pip install \ + --extra-index-url https://npm.pkg.github.com/kaihouproject \ + kaihou-engine +``` +You will need a personal access token with the `read:packages` scope stored in `~/.pypirc` or passed via environment variables. + +These alternatives let you distribute the engine without needing an account on PyPI. + ## Installation ```bash # Clone the repository From 44498bf0a4894ab9feb74f473a637fde43004d2d Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:35:37 +0000 Subject: [PATCH 6/9] Revert "Add alternative distribution methods section to README and release workflow to build wheels on tag" This reverts commit 63308bba52a39d2646d1c0d86059929a0d9bf709. --- .github/workflows/release.yml | 33 --------------------------------- README.md | 33 --------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f146bf0..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Release Build - -on: - push: - tags: - - 'v*.*.*' - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write # needed for creating a release - steps: - - uses: actions/checkout@v4 - with: - submodules: false - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.14" - - name: Install build tools - run: | - python -m pip install --upgrade pip build - - name: Build wheels and sdist - run: | - python -m build --sdist --wheel - - name: Upload Release Assets - uses: softprops/action-gh-release@v2 - with: - files: dist/* - tag_name: ${{ github.ref_name }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 4fbba77..011f432 100644 --- a/README.md +++ b/README.md @@ -61,39 +61,6 @@ Validation (numbers, entities, terminology, semantic similarity) ``` -## Installation - -## Alternative Distribution Methods - -You can install *Kaihou Engine* without publishing to PyPI using any of the following approaches: - -### 1. Direct install from GitHub (editable) -```bash -# Clone the repository (or just point pip to the URL) -python -m pip install -e git+https://github.com/kaihouproject/kaihou-engine.git@main#egg=kaihou-engine -``` -This installs the package in editable mode, so you can modify the source and the changes are reflected immediately. - -### 2. Install from a GitHub Release (wheel) -1. Create a release on GitHub (e.g., `v0.2.0`). The CI workflow will build a wheel and attach it as an asset. -2. Download the wheel asset and install it locally: -```bash -curl -L -o kaihou_engine-0.2.0-py3-none-any.whl \ - https://github.com/kaihouproject/kaihou-engine/releases/download/v0.2.0/kaihou_engine-0.2.0-py3-none-any.whl -python -m pip install kaihou_engine-0.2.0-py3-none-any.whl -``` - -### 3. Install from GitHub Packages (private or public registry) -If you enable GitHub Packages for the repository, you can publish the wheel there and install it with: -```bash -python -m pip install \ - --extra-index-url https://npm.pkg.github.com/kaihouproject \ - kaihou-engine -``` -You will need a personal access token with the `read:packages` scope stored in `~/.pypirc` or passed via environment variables. - -These alternatives let you distribute the engine without needing an account on PyPI. - ## Installation ```bash # Clone the repository From df68e52532f51a8479571184648ec84d18c9d185 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:39:41 +0000 Subject: [PATCH 7/9] Remove Alternative installation methods title from README --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 011f432..21fe694 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,25 @@ source .venv/bin/activate The installer automatically initializes any submodules (none are required now) and installs the required spaCy language models (`en`, `fr`, `es`). + + +If you prefer not to create a PyPI account, you can still obtain and install Kaihou Engine using these approaches: + +* **GitHub Releases** – The CI workflow builds wheels for each tag. When a release (e.g., `v0.2.0`) is published, download the attached `.whl` file and install it locally: + ```bash + curl -L -o kaihou_engine-0.2.0-py3-none-any.whl \ + https://github.com/kaihouproject/kaihou-engine/releases/download/v0.2.0/kaihou_engine-0.2.0-py3-none-any.whl + python -m pip install kaihou_engine-0.2.0-py3-none-any.whl + ``` + +* **Direct install from the repository** – Pip can install the package straight from the GitHub URL without any PyPI involvement: + ```bash + python -m pip install git+https://github.com/kaihouproject/kaihou-engine.git@main#egg=kaihou-engine + ``` + +Both methods work with the existing `install.sh` script, which does not depend on PyPI. After installation, activate the virtual environment (`source .venv/bin/activate`) and you are ready to use `kaihou` as described in the Quick‑Start section. + + ## Quick Start ```bash # Interactive menu From f6a31f89d673149d3b8c62851a7a5460a4ab41b9 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:45:43 +0000 Subject: [PATCH 8/9] =?UTF-8?q?Fix=20dependencies=20placement=20=E2=80=93?= =?UTF-8?q?=20move=20to=20[project]=20and=20keep=20URLs=20only=20in=20[pro?= =?UTF-8?q?ject.urls]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 487bbcd..de34e52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,10 +15,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -[project.urls] -Homepage = "https://github.com/houtarou/kaihou-engine" -Repository = "https://github.com/houtarou/kaihou-engine" -Documentation = "https://github.com/houtarou/kaihou-engine#readme" requires-python = ">=3.11" dependencies = [ "click", @@ -32,6 +28,11 @@ dependencies = [ "sentence-transformers" ] +[project.urls] +Homepage = "https://github.com/houtarou/kaihou-engine" +Repository = "https://github.com/houtarou/kaihou-engine" +Documentation = "https://github.com/houtarou/kaihou-engine#readme" + [project.optional-dependencies] dev = [ "pytest", From c93deda7bb34eb1bb5cfd0548aae8297dd927eb1 Mon Sep 17 00:00:00 2001 From: houtarou-d <165595881+houtarou-d@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:49:04 +0000 Subject: [PATCH 9/9] Fix import order in analyzer.py to satisfy ruff (E402) --- src/kaihou_engine/nlp_engine/analyzer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kaihou_engine/nlp_engine/analyzer.py b/src/kaihou_engine/nlp_engine/analyzer.py index d86a820..896578c 100644 --- a/src/kaihou_engine/nlp_engine/analyzer.py +++ b/src/kaihou_engine/nlp_engine/analyzer.py @@ -9,7 +9,8 @@ from __future__ import annotations from pathlib import Path -from typing import List +import spacy + @@ -23,7 +24,7 @@ "de": "de_core_news_sm", } -import spacy + def _load_model(lang: str):