generated from helpmefindaname/python-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
123 lines (105 loc) · 2.98 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
[tool.poetry]
name = "transformer-smaller-training-vocab"
version = "0.3.2"
description = "Temporary remove unused tokens during training to save ram and speed."
authors = ["Benedikt Fuchs <benedikt.fuchs.staw@hotmail.com>"]
license = "MIT"
readme = "README.md"
packages = [{ include = "transformer_smaller_training_vocab" }]
repository = "https://github.com/helpmefindaname/transformer-smaller-training-vocab"
[tool.poetry.dependencies]
python = "^3.8"
transformers = { version = "^4.1", extras = ["torch", "sentencepiece"] }
torch = ">=1.8.0,<3.0.0,!=2.0.1"
numpy = [
{version = "<1.25.0", python = ">=3.8,<3.9"}, # the newer versions do not ship python 3.8 wheels, hence we restrict it
{version = "^1.21.0", python = ">=3.9"}
]
[tool.poetry.group.datasets.dependencies]
datasets = "^2.0.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.2.0"
pytest-mypy = "^0.10.3"
black = "^22.12.0"
ruff = "==0.0.*"
pytest-github-actions-annotate-failures = "^0.1.8"
pytest-xdist = "^3.1.0"
pytest-cov = "^4.0.0"
pytest-ruff = "^0.0.6"
pytest-black-ng = "^0.4.1"
[tool.poetry.group.docs.dependencies]
sphinx-github-style = "^1.0.2"
sphinx-autodoc-typehints = "^1.23.0"
myst-parser = "^1.0.0"
sphinx = "<6.0.0"
importlib-metadata = "^6.6.0"
sphinx-multiversion = "^0.2.4"
pydata-sphinx-theme = "^0.13.3"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.black]
line-length = 120
target-version = ['py38']
[tool.ruff]
line-length = 120
target-version = 'py38'
select = [
"C4",
"COM",
"D",
"E",
"EXE",
"F",
"I",
"INP",
"ISC",
"NPY",
"PD",
"PGH",
"PIE",
"PLE",
"PYI",
"Q",
"RSE",
"RUF",
"SIM",
"T10",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
"COM812", # Do not force trailing commas for function argument lists
"D100", # Don't force presence of docstrings (D100-D107)
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"E501", # Ignore line too long
]
unfixable = [
"ERA", # Do not delete commented code
"EXE001", # Do not check python files for executability, doesn't work well on windows
"EXE002", # Do not check python files for executability, doesn't work well on windows
"F841", # Do not remove unused variables automatically
]
[tool.ruff.pydocstyle]
convention = "google"
[tool.pytest.ini_options]
addopts = "--mypy -n auto --black --ruff"
filterwarnings = [
"error",
"ignore:SelectableGroups dict interface is deprecated. Use select.",
'ignore:distutils Version classes are deprecated. Use packaging.version instead.', # numpy uses deprecated version check
] # Convert all warnings to errors, imo warnings that are not treated as errors will be ignored by most people.
# My approach is to throw an error and let the programmar check if the error is intended (then add it to the filterwarnings) or not (then fix it!)
testpaths=["transformer_smaller_training_vocab", "tests"]
[tool.mypy]
ignore_missing_imports = true
disallow_untyped_calls = true
warn_unused_ignores = true
warn_no_return = true