-
Notifications
You must be signed in to change notification settings - Fork 15
/
pyproject.toml
109 lines (95 loc) · 2.82 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
[tool.black]
force-exclude = '''
backend/orchestrator/.+_pb2(_grpc)?\.py
| backend/substrapp/tests/assets\.py
'''
line-length = 120
target-version = ['py39']
[tool.isort]
filter_files = true
force_single_line = true
line_length = 120
profile = "black"
skip_glob = ["backend/orchestrator/*_pb2.py", "backend/orchestrator/*_pb2_grpc.py"]
src_paths = ["backend", "metrics-exporter/metrics_exporter"]
[tool.pytest.ini_options]
testpaths = ["backend"]
markers = [
"serial", # no compatibility with xdist.
]
DJANGO_SETTINGS_MODULE = "backend.settings.test"
# we set no:unraisableexception because we have a lot of files left open due to Django models FileFields
addopts = "--cov=. --cov-config=../pyproject.toml -p no:unraisableexception"
filterwarnings = [
"error",
"ignore:pkg_resources is deprecated as an API:DeprecationWarning:checksumdir",
"ignore:CSR support in pyOpenSSL is deprecated. You should use the APIs in cryptography.:DeprecationWarning:josepy",
]
[tool.coverage.run]
branch = true
omit = [
"manage.py",
"backend/**",
"*/tests/**",
"*/migrations/*",
"orchestrator/*_pb2.py",
"orchestrator/*_pb2_grpc.py"
]
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about missing debug-only code:
"def __repr__",
'if self\.debug',
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain if non-runnable code isn't run:
"if 0:",
"if __name__ == .__main__.:",
# Don't complain about abstract methods, they aren't run:
'@(abc\.)?abstractmethod',
# Don't complain if no gpu during test
"if gpu_set",
"if __gpu_list",
"if cls.__gpu_sets",
"if 'environment' in job_args",
# Ignore functions,
"def prepare_training_task",
"def prepare_testing_task"
]
[tool.mypy]
python_version = 3.9
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main"
]
namespace_packages = true
explicit_package_bases = true
mypy_path = "backend"
disallow_untyped_defs = true
check_untyped_defs = true
ignore_missing_imports = true
cache_dir = "/dev/null"
follow_imports = "silent"
packages = [
"builder",
"substrapp.tasks",
]
exclude = [
"tests/*",
]
[tool.django-stubs]
django_settings_module = "backend.settings.test"
[tool.towncrier]
directory = "changes"
filename = "CHANGELOG.md"
start_string = "<!-- towncrier release notes start -->\n"
underlines = ["", "", ""]
title_format = "## [{version}](https://github.com/Substra/substra-backend/releases/tag/{version}) - {project_date}"
issue_format = "[#{issue}](https://github.com/Substra/substra-backend/pull/{issue})"
[tool.towncrier.fragment.added]
[tool.towncrier.fragment.removed]
[tool.towncrier.fragment.changed]
[tool.towncrier.fragment.fixed]