From 71f3d6d4a41b1a9f398f7e861693f551c46bcac3 Mon Sep 17 00:00:00 2001 From: Philip Meier Date: Thu, 4 Jul 2024 10:40:44 +0200 Subject: [PATCH] PoC for Ragna meta package --- meta-package/pyproject.toml | 35 +++++++++++++++++++++++++++++++++++ meta-package/setup.py | 22 ++++++++++++++++++++++ pyproject.toml | 23 +++++------------------ requirements-optional.txt | 9 +++++++++ 4 files changed, 71 insertions(+), 18 deletions(-) create mode 100644 meta-package/pyproject.toml create mode 100644 meta-package/setup.py create mode 100644 requirements-optional.txt diff --git a/meta-package/pyproject.toml b/meta-package/pyproject.toml new file mode 100644 index 00000000..8509564e --- /dev/null +++ b/meta-package/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = [ + "setuptools>=64", + "setuptools_scm>=8", + "tomlkit; python_version<'3.11'" +] +build-backend = "setuptools.build_meta" + +[project] +name = "Ragna" +description = "RAG orchestration framework" +license = {file = "LICENSE"} +authors = [ + { name = "Ragna Development Team", email = "connect@quansight.com" }, +] +readme = "README.md" +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.9" +dynamic = ["version", "dependencies"] + +[project.urls] +Homepage = "https://ragna.chat" +Documentation = "https://ragna.chat" +Changelog = "https://ragna.chat/en/stable/references/release-notes/" +Repository = "https://github.com/Quansight/ragna" + +[tool.setuptools_scm] +root = ".." +version_scheme = "release-branch-semver" +local_scheme = "node-and-date" diff --git a/meta-package/setup.py b/meta-package/setup.py new file mode 100644 index 00000000..1d6ab725 --- /dev/null +++ b/meta-package/setup.py @@ -0,0 +1,22 @@ +from pathlib import Path + +from setuptools import setup +from setuptools_scm import Configuration, get_version + +HERE = Path(__file__).parent +PROJECT_ROOT = HERE.parent + + +config = Configuration.from_file(PROJECT_ROOT / "pyproject.toml") +version = get_version( + root=str(PROJECT_ROOT), + version_scheme=config.version_scheme, + local_scheme=config.local_scheme, +) +install_requires = [f"{config.dist_name}=={version}"] + +with open(PROJECT_ROOT / "requirements-optional.txt") as file: + install_requires.extend(file.read().splitlines()) + + +setup(install_requires=install_requires) diff --git a/pyproject.toml b/pyproject.toml index 9ceb1569..71a7e01a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,13 @@ [build-system] requires = [ - "setuptools>=45", - "setuptools_scm[toml]>=6.2", + "setuptools>=64", + "setuptools_scm>=8", + "tomlkit; python_version<'3.11'", ] build-backend = "setuptools.build_meta" [project] -name = "Ragna" +name = "ragna-base" description = "RAG orchestration framework" license = {file = "LICENSE"} authors = [ @@ -50,24 +51,10 @@ Documentation = "https://ragna.chat" Changelog = "https://ragna.chat/en/stable/references/release-notes/" Repository = "https://github.com/Quansight/ragna" -[project.optional-dependencies] -# to update the array below, run scripts/update_optional_dependencies.py -all = [ - "chromadb>=0.4.13", - "httpx_sse", - "ijson", - "lancedb>=0.2", - "pyarrow", - "pymupdf>=1.23.6", - "python-docx", - "python-pptx", - "tiktoken", -] - [tool.setuptools_scm] write_to = "ragna/_version.py" version_scheme = "release-branch-semver" -local_scheme = "node-and-timestamp" +local_scheme = "node-and-date" [project.scripts] ragna = "ragna.__main__:app" diff --git a/requirements-optional.txt b/requirements-optional.txt new file mode 100644 index 00000000..16ae5be6 --- /dev/null +++ b/requirements-optional.txt @@ -0,0 +1,9 @@ +chromadb>=0.4.13 +httpx_sse +ijson +lancedb>=0.2 +pyarrow +pymupdf>=1.23.6 +python-docx +python-pptx +tiktoken