Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
122 lines (103 loc) · 3.68 KB
/
Copy pathpyproject.toml
File metadata and controls
122 lines (103 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "litkit"
version = "0.3.35"
description = "Literature tooling: ingest, embed, index, answer."
readme = "README.md"
requires-python = ">=3.12,<3.13"
license = { text = "MIT" }
authors = [{ name = "William S. Hlavacek", email = "hlavacek@lanl.gov" }]
dependencies = [
"lxml>=5.2,<6",
"sympy==1.13.1",
"numpy<2",
"safetensors>=0.4,<1",
"sentence-transformers>=3.1,<4",
"transformers>=4.44,<5",
"openai>=1,<2",
"faiss-cpu>=1.8,<1.9; sys_platform != 'win32'",
# The Windows post1 wheel crashes on HNSW inserts. 1.8.0 imports packaging
# without declaring it in its wheel metadata.
"faiss-cpu==1.8.0; sys_platform == 'win32'",
"packaging; sys_platform == 'win32'",
# Transformers needs torch 2.6+ to load SPECTER2's .bin weights on laptops.
"torch>=2.6; sys_platform == 'win32' or sys_platform == 'darwin'",
"torch>=2.5.1; sys_platform != 'win32' and sys_platform != 'darwin'",
]
# Advertise supported operating systems (informational)
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: MacOS :: MacOS X",
"License :: OSI Approved :: MIT License",
]
[project.optional-dependencies]
# Dev tools
dev = ["black", "ruff", "mypy", "pytest"]
[dependency-groups]
# uv installs this group by default, so a bare `uv sync` or `uv run pytest` gets the dev tools.
dev = ["litkit[dev]"]
[project.scripts]
litkit = "litkit.cli:main"
[project.urls]
"Repository" = "https://github.com/lanl/litkit"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
include = ["litkit*"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra --strict-markers -m 'not slow and not gpu and not network'"
markers = [
"slow: real models or builds that take more than a few seconds",
"gpu: needs a CUDA or Apple MPS device",
"network: needs network access or an API key",
]
# Formatting / linting
[tool.black]
line-length = 100
target-version = ["py312"]
[tool.ruff]
line-length = 100
target-version = "py312"
fix = true
unsafe-fixes = false
src = ["src", "tests"]
exclude = [".venv", "build", "dist", ".eggs", "*.egg-info", "workspace"]
[tool.ruff.lint]
select = ["E", "W", "F", "I", "UP", "B"] # Add "D" later.
ignore = ["E501", "D105", "D107"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = ["D"]
"src/litkit/cli.py" = ["E402", "B006", "B008", "B023"]
# Disclosure
[tool.litkit.ai_assistance]
used = true
models = ["ChatGPT"]
scope = ["refactoring", "docs", "packaging"]
human_reviewed = true
# --- uv resolver config (for reproducible GPU locking) ---
[tool.uv]
# Only resolve for the platform/arch/Python we actually ship.
environments = [
"sys_platform == 'linux' and platform_machine == 'aarch64' and python_full_version >= '3.12' and python_full_version < '3.13'",
"sys_platform == 'darwin' and platform_machine == 'arm64' and python_full_version >= '3.12' and python_full_version < '3.13'",
"sys_platform == 'win32' and (platform_machine == 'AMD64' or platform_machine == 'x86_64')",
]
# Linux ARM64 supplies torch in the container. Resolve torch only for laptops.
# Keep this lockfile override in sync with the wheel requirements above.
override-dependencies = [
"torch>=2.6 ; sys_platform == 'darwin' or sys_platform == 'win32'",
]
# Tell uv exactly where to get torch. This enforces our CUDA 12.5.0 build.
# [tool.uv.sources]
# torch = { path = "wheels/torch-2.5.1-cp312-cp312-linux_aarch64.whl" }