1
0
mirror of https://github.com/containers/ramalama.git synced 2026-02-05 15:47:26 +01:00
Files
ramalama/pyproject.toml

263 lines
5.6 KiB
TOML
Raw Normal View History

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "ramalama"
dynamic = ["version"]
description = "RamaLama is a command line tool for working with AI LLM models."
readme = "README.md"
requires-python = ">=3.10"
keywords = [
"ramalama",
"llama",
"ai",
"llm",
"large-language-model",
"inference",
"containers",
"podman",
"docker",
"gpu",
"rag",
]
dependencies = [
"argcomplete",
"pyyaml",
"jsonschema",
"jinja2",
]
maintainers = [
{ name = "Dan Walsh", email = "dawalsh@redhat.com" },
{ name = "Mike Bonnet", email = "mikeb@redhat.com" },
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: System Administrators",
"Operating System :: MacOS :: MacOS X",
Add comprehensive Windows platform support Enable RamaLama to run on Windows with Docker/Podman in a VM by fixing platform-specific compatibility issues throughout the codebase. Key changes: Path handling: - Add path_utils.py module for cross-platform path conversion - Implement normalize_host_path_for_container() to convert Windows paths (C:\Users\...) to container-friendly format (/c/Users/...) - Update RAG and transport modules to use path conversion for volume mounts - Fix Ollama cache detection to use os.path.expanduser() for HOME Configuration: - Add Windows-specific config paths (APPDATA, LOCALAPPDATA) - Make DEFAULT_CONFIG_DIRS platform-aware (Unix vs Windows) - Add Windows OS classifier to pyproject.toml - Update shortnames.py to use Windows-specific paths Unix-only APIs: - Make os.geteuid() calls conditional (not available on Windows) - Update get_default_store() and add_user() to check for geteuid - Add conditional checks before calling Unix-specific functions Signal handling: - Make SIGKILL, SIGALRM conditional (Windows only supports SIGINT/SIGTERM) - Add threading.Timer fallback for daemon idle checks on Windows - Implement conditional signal.alarm() checks in chat and daemon - Add graceful fallback in process cleanup for missing SIGKILL File locking: - Replace fcntl (Unix-only) with platform-specific locking - Use msvcrt.locking() on Windows for file locking - Maintain fcntl.flock() for Unix/Linux systems - Add proper exception handling for both platforms Model store (symlinks): - Add create_file_link() for cross-platform file linking - Try hardlink first (works on Windows without admin, space-efficient) - Fall back to symlink (Unix/Mac and Windows with developer mode) - Final fallback to copy (always works but uses more space) - Update all transport modules to use create_file_link() - Replace os.symlink() calls in model store, ollama, huggingface, modelscope This allows Windows users to run RamaLama with containerized models using Docker Desktop or Podman Desktop, with proper path translation between the Windows host and Linux containers, and without requiring admin privileges or developer mode for the model store. Cursor-AI-Generated Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-11-14 13:51:33 -05:00
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Utilities",
]
[project.license]
text = "MIT"
[project.optional-dependencies]
dev = [
# "pytest>=7.0",
"argcomplete~=3.0",
"bcrypt",
"black~=25.0",
"codespell~=2.0",
"flake8~=7.0",
"huggingface_hub~=1.3.1",
"hypothesis>=6.135.26",
"isort~=7.0",
"pytest~=9.0",
"wheel~=0.45.0",
"mypy",
"types-PyYAML",
"types-jsonschema",
"tox",
"requests"
]
cov = [
"ramalama[dev]",
"pytest-cov",
]
cov-detailed = [
"ramalama[cov]",
"pytest-func-cov",
"pytest-report",
"pytest-json",
"pytest-html",
]
[dependency-groups]
dev = [
"ramalama[cov-detailed]",
]
[project.urls]
Homepage = "https://github.com/containers/ramalama"
Repository = "https://github.com/containers/ramalama"
Issues = "https://github.com/containers/ramalama/issues"
Discussions = "https://github.com/containers/ramalama/discussions"
Discord = "https://discord.gg/MkCXuTRBUn"
Matrix = "https://matrix.to/#/#ramalama:fedoraproject.org"
[project.scripts]
ramalama = "ramalama.cli:main"
[tool.setuptools]
include-package-data = true
license-files = ["LICENSE"]
[tool.setuptools.package-data]
"ramalama" = ["py.typed"]
[tool.setuptools.dynamic]
version = {attr = "ramalama.version.version"}
[tool.black]
line-length = 120
skip-string-normalization = true
target-version = ["py310", "py311", "py312", "py313"]
extend-exclude = "(.history|build|dist|docs|hack)"
[tool.isort]
profile = "black"
line_length = 120
skip = [".venv", "venv", ".tox"]
[tool.codespell]
skip = ["build", "ramalama.egg-info", "logos", ".git", "venv", ".venv", ".tox", ".pixi"]
dictionary = ".codespelldict"
ignore-words-list = [
"assertin",
"cann",
"clos",
"creat",
"hastable",
"passt",
"ro",
"shouldnot",
]
check-hidden = true
[tool.ruff]
line-length = 120
target-version = "py312"
include = ["\\.pyi?$"]
exclude = [
"/\\.git",
"/\\.tox",
"/\\.venv",
"/\\.history",
"/build",
"/dist",
"/docs",
"/hack",
"/venv",
"/.pixi"
]
[tool.ruff.format]
preview = true
quote-style = "preserve"
[tool.coverage]
html.directory = "coverage/html"
xml.output = "coverage/coverage.xml"
json.output = "coverage/coverage.json"
lcov.output = "coverage/coverage.lcov"
[tool.pytest.ini_options]
testpaths = ["test"]
markers = ["e2e", "distro_integration"]
addopts = "-m 'not e2e' --color=yes"
[tool.setuptools.packages.find]
include = ["ramalama", "ramalama.*"]
[tool.setuptools.data-files]
"share/ramalama" = ["shortnames/shortnames.conf", "docs/ramalama.conf"]
"share/ramalama/inference" = [
"inference-spec/schema/*.json",
"inference-spec/engines/*",
]
"share/man/man1" = ["docs/*.1"]
"share/man/man5" = ["docs/*.5"]
"share/man/man7" = ["docs/*.7"]
"share/bash-completion/completions" = ["completions/bash-completion/completions/*"]
"share/zsh/site-functions" = ["completions/zsh/site-functions/*"]
"share/fish/vendor_completions.d" = ["completions/fish/vendor_completions.d/*"]
[tool.check-wheel-contents]
# W002 fails on duplicate files, and completions for bash and zsh are identical
ignore = ["W002"]
[tool.tox]
[tool.tox.env_run_base]
package = "wheel"
extras = ["dev", "cov"]
pass_env = [
"GITHUB_ACTIONS",
"RAMALAMA_*",
]
commands = [
[
"pytest",
"-vvv",
"--tb=short",
"--basetemp={envtmpdir}",
{ replace = "posargs", extend = true },
],
]
[tool.tox.env.e2e]
deps = [
"mlx-lm ; sys_platform == 'darwin' and platform_machine == 'arm64'"
]
commands = [
[
"pytest",
"-m", "e2e",
"-vvv",
"--basetemp={envtmpdir}",
"--tb=short",
{ replace = "posargs", extend = true },
],
]
[tool.tox.env.coverage]
extras = ["dev", "cov", "cov-detailed"]
commands = [
[
"pytest",
"-vvv",
"--cov",
"--cov-report=xml",
"--cov-report=html",
"--cov-report=json",
"--cov-report=lcov",
"--cov-report=term",
"--tb=short",
"--basetemp={envtmpdir}",
{ replace = "posargs", extend = true },
],
]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
[tool.pixi.pypi-dependencies]
ramalama = { path = ".", editable = true }
[tool.pixi.environments]
default = { solve-group = "default", features = [] }
cov = { features = ["cov"], solve-group = "default" }
cov-detailed = { features = ["cov-detailed"], solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" }
[tool.pixi.tasks]
[tool.pixi.dependencies]
tox = ">=4.30.2,<5"