[build-system] # https://python-poetry.org/docs/pyproject/#poetry-and-pep-517 requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry] # https://python-poetry.org/docs/pyproject/ name = "raglite" version = "0.2.0" description = "A Python toolkit for Retrieval-Augmented Generation (RAG) with SQLite or PostgreSQL." authors = ["Laurent Sorber "] readme = "README.md" repository = "https://github.com/superlinear-ai/raglite" [tool.commitizen] # https://commitizen-tools.github.io/commitizen/config/ bump_message = "bump(release): v$current_version → v$new_version" tag_format = "v$version" update_changelog_on_bump = true version_provider = "poetry" [tool.poetry.dependencies] # https://python-poetry.org/docs/dependency-specification/ # Python: python = ">=3.10,<4.0" # Markdown conversion: pdftext = ">=0.3.13" pypandoc-binary = { version = ">=1.13", optional = true } scikit-learn = ">=1.4.2" # Markdown formatting: markdown-it-py = ">=3.0.0" mdformat-gfm = ">=0.3.6" # Sentence and chunk splitting: numpy = ">=1.26.4" scipy = ">=1.5.0" spacy = ">=3.7.0,<3.8.0" # Large Language Models: huggingface-hub = ">=0.22.0" litellm = ">=1.47.1" llama-cpp-python = ">=0.2.88" pydantic = ">=2.7.0" # Approximate Nearest Neighbors: pynndescent = ">=0.5.12" # Reranking: langdetect = ">=1.0.9" rerankers = { extras = ["flashrank"], version = ">=0.5.3" } # Storage: pg8000 = ">=1.31.2" sqlmodel-slim = ">=0.0.18" # Progress: tqdm = ">=4.66.0" # Evaluation: pandas = ">=2.1.0" ragas = { version = ">=0.1.12", optional = true } # CLI: typer = ">=0.12.5" # Frontend: chainlit = { version = ">=1.2.0", optional = true } [tool.poetry.extras] # https://python-poetry.org/docs/pyproject/#extras chainlit = ["chainlit"] pandoc = ["pypandoc-binary"] ragas = ["ragas"] [tool.poetry.group.test.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/ commitizen = ">=3.29.1" coverage = { extras = ["toml"], version = ">=7.4.4" } mypy = ">=1.9.0" poethepoet = ">=0.25.0" pre-commit = ">=3.7.0" pytest = ">=8.1.1" pytest-mock = ">=3.14.0" ruff = ">=0.5.7" safety = ">=3.1.0" shellcheck-py = ">=0.10.0.1" typeguard = ">=4.2.1" xx_sent_ud_sm = { url = "https://github.com/explosion/spacy-models/releases/download/xx_sent_ud_sm-3.7.0/xx_sent_ud_sm-3.7.0-py3-none-any.whl" } [tool.poetry.group.dev.dependencies] # https://python-poetry.org/docs/master/managing-dependencies/ cruft = ">=2.15.0" ipykernel = ">=6.29.4" ipython = ">=8.8.0" ipywidgets = ">=8.1.2" matplotlib = ">=3.9.0" memory-profiler = ">=0.61.0" pdoc = ">=14.4.0" [tool.poetry.scripts] # https://python-poetry.org/docs/pyproject/#scripts raglite = "raglite:cli" [tool.coverage.report] # https://coverage.readthedocs.io/en/latest/config.html#report fail_under = 50 precision = 1 show_missing = true skip_covered = true [tool.coverage.run] # https://coverage.readthedocs.io/en/latest/config.html#run branch = true command_line = "--module pytest" data_file = "reports/.coverage" source = ["src"] [tool.coverage.xml] # https://coverage.readthedocs.io/en/latest/config.html#xml output = "reports/coverage.xml" [tool.mypy] # https://mypy.readthedocs.io/en/latest/config_file.html junit_xml = "reports/mypy.xml" strict = true disallow_subclassing_any = false disallow_untyped_decorators = false ignore_missing_imports = true pretty = true show_column_numbers = true show_error_codes = true show_error_context = true warn_unreachable = true [tool.pytest.ini_options] # https://docs.pytest.org/en/latest/reference/reference.html#ini-options-ref addopts = "--color=yes --exitfirst --failed-first --strict-config --strict-markers --verbosity=2 --junitxml=reports/pytest.xml" filterwarnings = ["error", "ignore::DeprecationWarning", "ignore::pytest.PytestUnraisableExceptionWarning"] testpaths = ["src", "tests"] xfail_strict = true [tool.ruff] # https://github.com/charliermarsh/ruff fix = true line-length = 100 src = ["src", "tests"] target-version = "py310" [tool.ruff.lint] select = ["A", "ASYNC", "B", "BLE", "C4", "C90", "D", "DTZ", "E", "EM", "ERA", "F", "FBT", "FLY", "FURB", "G", "I", "ICN", "INP", "INT", "ISC", "LOG", "N", "NPY", "PERF", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "Q", "RET", "RSE", "RUF", "S", "SIM", "SLF", "SLOT", "T10", "T20", "TCH", "TID", "TRY", "UP", "W", "YTT"] ignore = ["D203", "D213", "E501", "RET504", "RUF002", "S101", "S307"] unfixable = ["ERA001", "F401", "F841", "T201", "T203"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" [tool.ruff.lint.pycodestyle] max-doc-length = 100 [tool.ruff.lint.pydocstyle] convention = "numpy" [tool.poe.tasks] # https://github.com/nat-n/poethepoet [tool.poe.tasks.docs] help = "Generate this package's docs" cmd = """ pdoc --docformat $docformat --output-directory $outputdirectory raglite """ [[tool.poe.tasks.docs.args]] help = "The docstring style (default: numpy)" name = "docformat" options = ["--docformat"] default = "numpy" [[tool.poe.tasks.docs.args]] help = "The output directory (default: docs)" name = "outputdirectory" options = ["--output-directory"] default = "docs" [tool.poe.tasks.lint] help = "Lint this package" [[tool.poe.tasks.lint.sequence]] cmd = """ pre-commit run --all-files --color always """ [[tool.poe.tasks.lint.sequence]] shell = "safety check --continue-on-error --full-report" [tool.poe.tasks.test] help = "Test this package" [[tool.poe.tasks.test.sequence]] cmd = "coverage run" [[tool.poe.tasks.test.sequence]] cmd = "coverage report" [[tool.poe.tasks.test.sequence]] cmd = "coverage xml"