-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
156 lines (138 loc) · 3.72 KB
/
pyproject.toml
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
[tool.poetry]
name = "cycleformers"
packages = [
{ from = "src", include = "cycleformers" },
]
version = "0.1.0"
description = "A comprehensive implementation of the cycle-consistency training paradigm, extending the Huggingface Transformers trainer API to accommodate arbitrary combinations of generative models."
authors = ["William Thorne <[email protected]>"]
license = "Attribution 4.0 International"
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.11,<3.13"
transformers = "4.46"
torch = "^2.5.0"
datasets = "^3.0.2"
typing-extensions = {version = "^4.12.2", python = ">=3.8,<3.12"}
peft = "^0.13.2" # TODO: Add importutils is_peft_available methods and remove dependency
[tool.poetry.group.dev.dependencies]
bandit = "^1.8.0"
pre-commit = "^4.0.1"
ruff = "^0.7.1"
mypy = "^1.13.0"
semantic-release = "^0.1.0"
genbadge = {extras = ["build", "coverage"], version = "^1.1.1"}
pytest = "^8.3.3"
pytest-cov = "^6.0.0"
pytest-benchmark = "^5.1.0"
pytest-xdist = "^3.6.1"
pytest-sugar = "^1.0.0"
pytest-instafail = "^0.5.0"
pytest-flakefinder = "^1.1.0"
pytest-picked = "^0.5.1"
pytest-random-order = "^1.1.1"
[tool.poetry.group.profiling.dependencies]
memory-profiler = "^0.61.0"
snakeviz = "^2.2.2"
torch-tb-profiler = "^0.4.3"
tensorboard-plugin-profile = "^2.18.0"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
mkdocstrings = {extras = ["python"], version = "^0.26.2"}
mkdocs-material = "^9.5.43"
pygments = "^2.18.0"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"misc",
]
# Same as Transformers.
line-length = 119
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
# Same as Transformers.
ignore = ["C901", "E501", "E741", "F402", "F823" ]
select = [
"C",
"E",
"F",
"I",
"W",
"UP006", # Use built-in types instead of typing ones (list vs List)
"UP007", # Use | instead of Union
"UP008", # Use | None instead of Optional
"UP009", # Use collections.abc instead of typing
"UP035", # Remove redundant unions
]
[tool.ruff.lint.isort]
lines-after-imports = 2
known-first-party = ["cycleformers"]
[tool.ruff.format]
# Same as Transformers.
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.per-file-ignores]
# Ignore import violations in all `__init__.py` files.
"__init__.py" = ["F401"]
[[tool.mypy.overrides]]
module = "accelerate.*,datasets.*,transformers.*"
ignore_missing_imports = true
[tool.pytest.ini_options]
markers = [
"slow: mark test as slow to run (run with --slow to enable)",
"meta: mark test as a test of the testing framework (run with --meta to enable)",
"requires_gpu: mark test as requiring a GPU or taking far too long to run on a CPU (skip with --no-gpu)"
]
[tool.coverage.run]
data_file = ".coverage"
source = ["src/cycleformers"]
omit = [
"tests/*",
"misc/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
]
[tool.semantic_release]
version_variable = [
"src/cycleformers/__init__.py",
"pyproject.toml:version",
]
parser_angular_allowed_types = "build, chore, ci, docs, feat, fix, perf, style, refactor, test"
parser_angular_minor_types = "feat"
parser_angular_patch_types = "fix, perf"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"