From 2fbc4f33e21fb3b9a86fc6bcf3a6d63bb73a84e5 Mon Sep 17 00:00:00 2001 From: mmprotest Date: Sat, 4 Oct 2025 16:12:24 +1000 Subject: [PATCH] Prep project metadata for PyPI release --- README.md | 26 ++++++++++++++++++++++++-- pyproject.toml | 25 +++++++++++++++++++++++++ src/raglite/__init__.py | 8 ++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7d555af..9d9b11a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![CI](https://github.com/mmprotest/raglite-sqlite/actions/workflows/ci.yml/badge.svg)](https://github.com/mmprotest/raglite-sqlite/actions/workflows/ci.yml) ![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg) ![Python: 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg) -![PyPI: TODO](https://img.shields.io/badge/PyPI-TODO-lightgrey.svg) +[![PyPI](https://img.shields.io/pypi/v/raglite.svg)](https://pypi.org/project/raglite/) Local-first retrieval augmented generation toolkit built on SQLite. Raglite bundles ingestion, chunking, hybrid BM25/vector search, Typer CLI workflows, and a FastAPI @@ -13,7 +13,7 @@ microservice. Everything runs on CPU and stores state in a single SQLite databas ```bash python -m venv .venv && source .venv/bin/activate -pip install -e .[server] +pip install "raglite[server]" raglite init-db --db demo.db raglite ingest --db demo.db --path demo/mini_corpus raglite query --db demo.db --text "quick start guide" --k 5 --alpha 0.6 @@ -22,6 +22,28 @@ raglite serve --db demo.db --host 127.0.0.1 --port 8080 _On Windows use `\.venv\Scripts\activate` for step two._ +## Installation + +Raglite is published as [`raglite` on PyPI](https://pypi.org/project/raglite/). Install the +core toolkit with: + +```bash +pip install raglite +``` + +To enable the optional FastAPI server, install the `server` extra: + +```bash +pip install "raglite[server]" +``` + +Development dependencies (linters, type checkers, packaging utilities) can be installed +with the `dev` extra: + +```bash +pip install "raglite[dev]" +``` + ## Features - Deterministic chunking and debug embeddings for air-gapped demos, with an easy upgrade diff --git a/pyproject.toml b/pyproject.toml index f0caf42..9a4ca08 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,25 @@ readme = "README.md" authors = [{ name = "RagLite Contributors" }] license = { file = "LICENSE" } requires-python = ">=3.10" +keywords = [ + "rag", + "retrieval-augmented-generation", + "sqlite", + "search", + "llm", +] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Database", + "Topic :: Scientific/Engineering :: Artificial Intelligence", +] dependencies = [ "typer>=0.9.0", "readability-lxml>=0.8.1", @@ -31,6 +50,7 @@ rerank = [ "sentence-transformers>=2.5.0", ] dev = [ + "build>=1.2.1", "pytest>=8.1.0", "pytest-cov>=4.1.0", "mypy>=1.8.0", @@ -38,6 +58,7 @@ dev = [ "black>=24.4.0", "isort>=5.13.2", "pre-commit>=3.6.0", + "twine>=5.1.1", ] [project.urls] @@ -50,6 +71,10 @@ raglite = "raglite.cli:app" [tool.setuptools.packages.find] where = ["src"] +[tool.setuptools] +package-dir = {"" = "src"} +include-package-data = true + [tool.setuptools.package-data] raglite = ["schema.sql", "data/eval_set.jsonl", "data/mini_corpus/*"] diff --git a/src/raglite/__init__.py b/src/raglite/__init__.py index 1f04fb1..9103b82 100644 --- a/src/raglite/__init__.py +++ b/src/raglite/__init__.py @@ -1,8 +1,15 @@ """raglite - local-first RAG toolkit built on SQLite.""" +from importlib import metadata as importlib_metadata + from .api import RagliteAPI, add_tags, index_corpus, init_db, query, stats from .config import RagliteConfig +try: + __version__ = importlib_metadata.version("raglite") +except importlib_metadata.PackageNotFoundError: # pragma: no cover - fallback for dev installs + __version__ = "0.0.0" + __all__ = [ "RagliteAPI", "RagliteConfig", @@ -11,4 +18,5 @@ "init_db", "query", "stats", + "__version__", ]