-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
pyproject.toml
112 lines (104 loc) · 3.81 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
[tool.black]
line-length = 120
target-version = ['py37']
exclude = '''
(
/(
\.eggs
| \.git
| \.pytest_cache
| build
| dist
| venv
)/
)
'''
[tool.pytest.ini_options]
addopts = "--black --mypy --ruff"
filterwarnings = [
"error", # Convert all warnings to errors
'ignore:torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables', # Distilbert warning
'ignore:TorchScript will treat type annotations of Tensor:UserWarning', # Torch onnx export warns about it ignoring types, however we still like types.
'ignore:Please use `triu` from the `scipy.linalg` namespace, the `scipy.linalg.special_matrices` namespace is deprecated.', # ignore gensim using deprecated scipy
'ignore:bilinear is deprecated and will be removed in Pillow 10', # huggingface layoutlmv2 has deprecated calls.
'ignore:nearest is deprecated and will be removed in Pillow 10', # huggingface layoutlmv2 has deprecated calls.
'ignore:The `device` argument is deprecated and will be removed in v5 of Transformers.', # hf layoutlmv3 calls deprecated hf.
"ignore:the imp module is deprecated:DeprecationWarning:past", # ignore DeprecationWarning from hyperopt dependency
"ignore:.*imp module.*:DeprecationWarning", # ignore DeprecationWarnings that involve imp module
"ignore:The class LayoutLMv3FeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please use LayoutLMv3ImageProcessor instead.", # huggingface layoutlmv3 has deprecated calls.
"ignore:pkg_resources", # huggingface has deprecated calls.
'ignore:Deprecated call to `pkg_resources', # huggingface has deprecated calls.
'ignore:distutils Version classes are deprecated.', # faiss uses deprecated distutils.
'ignore:`resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.', # transformers calls deprecated hf_hub
"ignore:`torch.cuda.amp.GradScaler", # GradScaler changes in torch 2.3.0 but we want to be backwards compatible.
"ignore:`clean_up_tokenization_spaces` was not set", # Default behavior changes in transformers v4.45, raising irrelevant FutureWarning for serialized models.
]
markers = [
"integration",
]
testpaths = ["flair", "tests"]
[tool.mypy]
ignore_missing_imports = true
disable_error_code = ["annotation-unchecked"]
exclude = [".git/", ".venv/", "__pycache__", "build", "venv"]
warn_unused_ignores = true
[[tool.mypy.overrides]]
module="flair.embeddings.legacy"
ignore_errors = true
[tool.ruff]
line-length = 120
target-version = "py38"
[tool.ruff.lint]
#select = ["ALL"] # Uncommit to autofix all the things
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
"RUF012",
]
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.lint.per-file-ignores]
"flair/embeddings/legacy.py" = ["D205"]
"scripts/*" = ["INP001"] # no need for __ini__ for scripts
"flair/datasets/*" = ["D417"] # need to fix datasets in a unified way later.
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pydocstyle]
match = "^(?!legacy).*\\.py$"