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/README.md b/README.md index abdb4b9..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 @@ -97,6 +116,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) diff --git a/pyproject.toml b/pyproject.toml index f3e3d74..de34e52 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,12 @@ 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", +] requires-python = ">=3.11" dependencies = [ "click", @@ -22,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", 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):