forked from modulabs-personalab/psyctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
137 lines (119 loc) · 3.52 KB
/
pyproject.toml
File metadata and controls
137 lines (119 loc) · 3.52 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
[project]
name = "psyctl"
version = "0.1.0"
description = "LLM Personality Steering Tool"
authors = [
{ name = "Rick Choi", email = "rick@caveduck.io" },
{ name = "Dohoon Kwon", email = "lk38ll@gmail.com" },
{ name = "Changhoon Lee", email = "ggomaseein@gmail.com" },
{ name = "cognitive-glitch", email = "drivedon02@gmail.com" },
]
readme = "README.md"
requires-python = ">=3.11"
packages = [{ include = "psyctl", from = "src" }]
dependencies = [
"click>=8.3.0", # CLI 프레임워크
"rich>=14.0.0", # 터미널 출력 개선
"torch>=2.7.0", # PyTorch with CUDA support
"transformers>=4.56.0", # Hugging Face Transformers
"tokenizers>=0.20.0", # Hugging Face Tokenizers
"safetensors>=0.6.2", # SafeTensors
"datasets>=4.2.0", # Hugging Face Datasets
"numpy>=2.0", # NumPy
"pandas>=2.0", # Pandas
"scikit-learn>=1.5", # Scikit-learn
"accelerate>=1.10.0", # Hugging Face Accelerate
"python-dotenv>=1.0.0", # Environment variable management
]
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"pytest-cov>=7.0",
"pytest-mock>=3.15",
"pytest-pdb>=0.2.0",
"ruff>=0.14.0", # Modern linter and formatter (replaces black, isort, flake8)
"pyright>=1.1.406", # Static type checker (replaces mypy)
"jupyter>=1.0.0",
]
[project.scripts]
psyctl = "psyctl.cli:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/psyctl"]
# Ruff configuration (replaces black, isort, flake8)
[tool.ruff]
line-length = 88
target-version = "py311"
src = ["src", "tests"]
# Enable preview features for latest improvements
preview = true
[tool.ruff.lint]
# Enable comprehensive rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"PERF", # flake8-performance
"RUF", # Ruff-specific rules
]
# Ignore specific rules that conflict with our style
ignore = [
"E501", # Line too long (handled by formatter)
"B905", # zip() without strict parameter
"N812", # Lowercase imported as non-lowercase (for torch.nn as nn)
"UP007", # Use X | Y for type annotations (Python 3.11 with future annotations)
]
# Allow autofix for all enabled rules
fixable = ["ALL"]
unfixable = []
[tool.ruff.lint.isort]
known-first-party = ["psyctl"]
combine-as-imports = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# Pyright configuration (strict mode)
[tool.pyright]
# Target Python version
pythonVersion = "3.11"
# Include/exclude patterns
include = ["src"]
exclude = [
"**/__pycache__",
".venv",
"temp",
"dataset",
"steering_vector",
"results",
]
# Type checking mode
typeCheckingMode = "standard"
[tool.pytest.ini_options]
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
addopts = ["--tb=short", "--strict-markers", "--disable-warnings"]
[dependency-groups]
dev = [
"ruff>=0.8.4",
"pyright>=1.1.390",
"pytest>=8.4.1",
"pytest-cov>=7.0.0",
"pytest-mock>=3.14.1",
"jupyter>=1.1.1",
"pre-commit>=4.0.0",
]
[tool.uv.sources]
# Linux/Windows에만 CUDA 12.6 휠을 사용, macOS는 PyPI로 폴백
torch = [
{ index = "pytorch-cu126", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
]
[[tool.uv.index]]
name = "pytorch-cu126"
url = "https://download.pytorch.org/whl/cu126"
explicit = true