-
Notifications
You must be signed in to change notification settings - Fork 367
Expand file tree
/
Copy pathpyproject.toml
More file actions
244 lines (221 loc) · 6.45 KB
/
pyproject.toml
File metadata and controls
244 lines (221 loc) · 6.45 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
[project]
name = "py-data-juicer"
dynamic = ["version"]
description = "Data Processing for and with Foundation Models."
authors = [
{name = "SysML Team of Alibaba Tongyi Lab"}
]
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.10"
urls = {repository = "https://github.com/datajuicer/data-juicer"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Operating System :: OS Independent"
]
# Core dependencies
dependencies = [
"datasets>=4.7.0", # core data loading
"fsspec==2023.5.0", # file system operations
"pandas", # data manipulation
"numpy>=1.26.4,<2.0.0", # numerical operations
"loguru", # logging
"tqdm", # progress bars
"jsonargparse[signatures]", # configuration
"jsonlines", # JSONL handling
"zstandard", # compression
"lz4", # compression
"multiprocess==0.70.16", # parallel processing
"dill==0.3.8", # serialization
"psutil", # system monitoring
"pydantic>=2.0", # data validation
"uv",
"httpx",
"emoji==2.2.0", # emoji handling
"tabulate",
"bs4",
"requests",
"wget",
"streamlit",
"Pillow",
"mwparserfromhell",
"regex", # regular expressions
"tomli",
"tomli-w",
"gitpython",
"dep-logic",
]
[project.optional-dependencies]
# Generic ML & DL
generic = [
"torch==2.8.0", # PyTorch
"transformers==4.57.1", # Hugging Face Transformers
"einops", # Tensor operations
"accelerate", # Model acceleration
"vllm==0.11.0", # LLM serving
"uvloop==0.21.0", # avoid async error before it's fixed in uvloop
"onnxruntime", # ONNX runtime
"cudf-cu12==25.10.0; sys_platform == 'linux'", # dataframe on GPU (Linux only)
]
# Computer Vision
vision = [
"av==13.1.0", # video/audio handling
"opencv-contrib-python",
"imagededup", # Image deduplication
"diffusers>=0.33.0", # Diffusion models
"simple-aesthetics-predictor", # Image aesthetics
"scenedetect[opencv]", # Scene detection
"ultralytics", # YOLO models
"rembg", # Background removal
"decord", # video/audio handling
"qwen-vl-utils==0.0.14", # for Qwen-VL
"ptlflow==0.4.1", # optical flow models collection
"timm==1.0.22", # avoid importing issue in the latest v1.0.23
]
# Natural Language Processing
nlp = [
"nltk==3.9.1", # NLP toolkit
"easyocr==1.7.1", # OCR
"fasttext-wheel", # FastText
"kenlm", # Language modeling
"sentencepiece", # Tokenization
"ftfy", # Text fixing
"simhash-pybind", # Text similarity
"selectolax", # HTML parsing
"nlpaug", # Text augmentation
"nlpcda", # Chinese text augmentation
"tiktoken", # Token counting
"opencc==1.1.9", # Chinese conversion
"spacy-pkuseg", # Chinese segmentation
"rouge", # Text evaluation
"pdfplumber", # For PDF input and processing
"spacy==3.8.7",
"python-docx", # For docx input and processing
]
# Audio Processing
audio = [
"librosa>=0.10",
"resampy",
"samplerate==0.1.0",
"torchaudio", # Audio processing with PyTorch
"torchcodec==0.7",
"soundfile", # audio handling
"ffmpeg-python",
"audiomentations",
]
# Distributed Computing
distributed = [
"ray[default]>=2.51.0", # distributed computing
"uvloop==0.21.0", # avoid async error before it's fixed in uvloop
"pyspark==3.5.5", # distributed data processing
"s3fs", # S3 filesystem support for cloud storage
"boto3", # AWS SDK for S3 operations
"bitarray", # efficient arrays of booleans
"pylance", # to support I/O for lance data in ray mode
]
# Development & Tools
dev = [
"coverage",
"pre-commit", # pre-commit hooks
"sphinx",
"sphinx-autobuild",
"sphinx_copybutton",
"furo",
"myst_parser",
"linkify-it-py",
"recommonmark",
"wandb<=0.19.0",
"fire",
"click",
"toml", # for yapf configuration
"pytest", # testing framework
"pytest-cov", # coverage reporting
"build", # package building
"black>=25.1.0",
"flake8-black",
"docstring-parser>=0.16",
]
# AI Services & APIs
ai_services = [
"dashscope", # Alibaba Cloud AI
"openai", # OpenAI API
"label-studio==1.17.0", # Data labeling
]
# tools, including analysis, mcp, ...
tools = [
"matplotlib", # For drawing analysis results
"wordcloud==1.9.4", # For drawing word clouds
"mcp[cli]>=1.7.0", # For mcp service
"rank-bm25>=0.2.2", # For OP search
"fastapi>=0.110", # For using data-juicer in a service way
]
# All dependencies (default + all optional)
all = [
"py-data-juicer[generic]",
"py-data-juicer[vision]",
"py-data-juicer[nlp]",
"py-data-juicer[audio]",
"py-data-juicer[distributed]",
"py-data-juicer[dev]",
"py-data-juicer[ai_services]",
"py-data-juicer[tools]",
]
[project.scripts]
dj-process = "data_juicer.tools.process_data:main"
dj-analyze = "data_juicer.tools.analyze_data:main"
dj-install = "data_juicer.tools.dj_install:main"
dj-mcp = "data_juicer.tools.mcp_server:main"
[build-system]
requires = [
"hatchling",
"uv>=0.1.0",
"Cython>=0.29",
"pybind11>=2.6",
"setuptools>=64",
]
build-backend = "hatchling.build"
[tool.hatch.version]
path = "data_juicer/__init__.py"
[tool.hatch.build.targets.wheel]
packages = ["data_juicer", "tools"]
include = ["uv.lock", "pyproject.toml"]
[tool.hatch.build.targets.wheel.hooks.custom]
path = "hatch_build.py"
[tool.hatch.build]
include = ["uv.lock", "pyproject.toml"]
[tool.hatch.build.targets.wheel.shared-data]
"uv.lock" = "uv.lock"
"pyproject.toml" = "pyproject.toml"
[tool.flake8]
per-file-ignores = [
"*/__init__.py: F401"
]
max-line-length = 120
extend-ignore = [
"E203", # whitespace before ':' (black handles this)
"E501", # line too long (black handles this)
"BLK100", # black would make changes (black handles this)
"F541", # f-string is missing placeholders
]
[tool.black]
line-length = 120
target-version = ['py310']
[tool.isort]
profile = "black"
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["*Test", "Test*"]
python_functions = ["test_*"]
addopts = "-v"
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
[tool.uv]
override-dependencies = [
"opencv-python; sys_platform == 'never'",
"opencv-python-headless; sys_platform == 'never'",
"opencv-contrib-python-headless; sys_platform == 'never'", # never install other versions of opencv-python
]