Skip to content

Commit 556a989

Browse files
authored
feat: pyproject.toml (#47)
* feat: update pyproject.toml with dependencies and configuration for project setup
1 parent e21c177 commit 556a989

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,113 @@ exclude = [
4646
"asset*",
4747
"pages*",
4848
]
49+
50+
[build-system]
51+
requires = ["setuptools>=61.0"]
52+
build-backend = "setuptools.build_meta"
53+
54+
[project]
55+
name = "onevision-encoder"
56+
version = "0.1.0"
57+
description = "HEVC-Style Vision Transformer for efficient video understanding"
58+
readme = "README.md"
59+
license = {text = "Apache-2.0"}
60+
requires-python = ">=3.8"
61+
dependencies = [
62+
"torch>=2.0.0",
63+
"transformers>=4.40.0",
64+
"timm>=0.9.0",
65+
"numpy",
66+
"Pillow",
67+
]
68+
69+
[project.optional-dependencies]
70+
train = [
71+
"tensorboard",
72+
"nvidia-dali-cuda110",
73+
"decord",
74+
]
75+
dev = [
76+
"pytest",
77+
"black",
78+
"isort",
79+
]
80+
81+
[tool.setuptools.packages.find]
82+
where = ["."]
83+
include = [
84+
"onevision_encoder*",
85+
"dataloader*",
86+
"model_factory*",
87+
"training*",
88+
"dataset*",
89+
"eval_encoder*",
90+
]
91+
exclude = [
92+
"shells*",
93+
"tools*",
94+
"llava_next*",
95+
"asset*",
96+
"pages*",
97+
]
98+
99+
100+
[tool.ruff]
101+
target-version = "py310"
102+
line-length = 119
103+
104+
[tool.ruff.lint]
105+
# Never enforce `E501` (line length violations).
106+
# SIM300: Yoda condition detected
107+
# SIM212: Checks for if expressions that check against a negated condition.
108+
# SIM905: Consider using a list literal instead of `str.split`
109+
# UP009: UTF-8 encoding declaration is unnecessary
110+
# UP015: Unnecessary mode argument
111+
# UP031: Use format specifiers instead of percent format
112+
# UP004: Class `XXX` inherits from `object`
113+
# UP028: Checks for for loops that can be replaced with yield from expressions
114+
# UP045: Use `X | None` for type annotations
115+
# UP007: Use `X | Y` for type annotations
116+
ignore = ["C901", "E501", "E741", "F402", "F823", "SIM1", "SIM300", "SIM212", "SIM905", "UP009", "UP015", "UP031", "UP028", "UP004", "UP045", "UP007"]
117+
# RUF013: Checks for the use of implicit Optional
118+
# in type annotations when the default parameter value is None.
119+
select = ["C", "E", "F", "I", "W", "RUF013", "PERF102", "PLC1802", "PLC0208", "SIM", "UP", "PIE794", "FURB"]
120+
extend-safe-fixes = ["UP006"]
121+
122+
# Ignore import violations in all `__init__.py` files.
123+
[tool.ruff.lint.per-file-ignores]
124+
"__init__.py" = ["E402", "F401", "F403", "F811"]
125+
"src/transformers/file_utils.py" = ["F401"]
126+
"src/transformers/utils/dummy_*.py" = ["F401"]
127+
"examples/legacy/**/*.py" = ["UP"]
128+
129+
[tool.ruff.lint.isort]
130+
lines-after-imports = 2
131+
known-first-party = ["transformers"]
132+
133+
[tool.ruff.format]
134+
# Like Black, use double quotes for strings.
135+
quote-style = "double"
136+
137+
# Like Black, indent with spaces, rather than tabs.
138+
indent-style = "space"
139+
140+
# Like Black, respect magic trailing commas.
141+
skip-magic-trailing-comma = false
142+
143+
# Like Black, automatically detect the appropriate line ending.
144+
line-ending = "auto"
145+
146+
[tool.pytest.ini_options]
147+
addopts = "--doctest-glob='**/*.md'"
148+
doctest_optionflags="NUMBER NORMALIZE_WHITESPACE ELLIPSIS"
149+
markers = [
150+
"flash_attn_3_test: marks tests related to flash attention 3 (deselect with '-m \"not flash_attn_3_test\"')",
151+
"flash_attn_test: marks tests related to flash attention (deselect with '-m \"not flash_attn_test\"')",
152+
"bitsandbytes: select (or deselect with `not`) bitsandbytes integration tests",
153+
"generate: marks tests that use the GenerationTesterMixin",
154+
"is_training_test: marks tests that use the TrainingTesterMixin (deselect with '-m \"not is_training_test\"')",
155+
]
156+
log_cli = 1
157+
log_cli_level = "WARNING"
158+
asyncio_default_fixture_loop_scope = "function"

0 commit comments

Comments
 (0)