-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
146 lines (130 loc) · 3.72 KB
/
Copy pathpyproject.toml
File metadata and controls
146 lines (130 loc) · 3.72 KB
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
[project]
name = "scratch"
version = "0.0.1"
description = "Scratch"
readme = "README.md"
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python :: 3.13',
'License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)',
]
requires-python = ">=3.13"
dependencies = [
"fastapi[standard]>=0.119.0",
"lir>=1.4.0",
"loguru>=0.7.3",
"lr_module_scratch @ git+https://github.com/NetherlandsForensicInstitute/lr_module_scratch.git@v0.1",
"pydantic>=2.12.4",
"pydantic-settings>=2.0.0",
"uvicorn>=0.38.0",
"scratch-core",
"numpy>=2.3.5",
"scipy>=1.16.3",
"scikit-image>=0.25.2",
"pillow>=12.0.0",
"opencv-python>=4.13.0.92",
"matplotlib>=3.10.7",
"threadpoolctl>=3.6.0",
]
# https://docs.astral.sh/uv/concepts/projects/workspaces/
[tool.uv.sources]
scratch-core = { workspace = true }
[tool.uv.workspace]
members = ["packages/*"]
exclude = ["**/__pycache__"]
[dependency-groups]
dev = [
"deptry>=0.23.1",
"diff-cover>=9.7.1",
"hypothesis>=6.148.2",
"ipykernel>=7.0.0",
"pre-commit>=4.3.0",
"pyinstaller>=6.16.0",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"pytest-loguru>=0.4.0",
"pytest-watcher>=0.4.3",
"requests>=2.32.5",
"ruff>=0.14.0",
"rust-just>=1.43.0",
"pyright>=1.1.407",
"tqdm>=4.67.1",
"scipy-stubs~=1.16.3",
]
[tool.ruff]
line-length = 120
target-version = "py313"
fix = true
[tool.ruff.format]
preview = true
[tool.ruff.lint]
select = [
"I", # isort
"NPY", # numpy specific rules
"UP", # pyupgrade
"D", # pydocstyle
"N", # pep8-naming
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"PL", # pylint
"S", # flake8-bandit
"PT", # flake8-pytest-style
]
ignore = [
'D100', # no module docstring required at top of each file
'D101', # no class docstring required (only in __init__)
'D104', # no docstring in __init__.py of public package required
'D105', # no docstring in magic methods (like __eq__) required, since they are not class dependent
'PLE0604', # no restriction on having only strings in __all__ definitions
]
[tool.ruff.lint.pydocstyle]
convention = "numpy" # docstring type to use
ignore-decorators = ["property"]
[tool.ruff.lint.per-file-ignores]
"**/tests/**/*.py" = [
"S101", # Exclude the 'use of assert' warning in the test files
"D103", # No docstring necessary for tests
"PT011", # No `match` parameter necessary for pytest.raises
"PLR0913", # Pytest fixtures naturally lead to many function parameters
]
"**/scripts/*.py" = [
"PLR0913", # Scripts are allowed to have manu function parameters
]
[tool.ty.environment]
python-version = "3.13"
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests", "packages/**/tests"]
addopts = [
"--import-mode=importlib",
"--cov-config=pyproject.toml",
"--cov-report=term",
]
markers = [
"integration: Tests related to more than one unit (examples: modules, interfaces)",
"e2e: End to end test (full system test)",
"contract_testing: all tests used for checking if the interface to the outside is same as contract",
"lfs: Tests that utilizes resources stored in the large file storage",
]
[tool.coverage.report]
fail_under = 80
skip_empty = true
skip_covered = true
show_missing = true
omit = ["src/main.py"]
[tool.coverage.run]
branch = true
source = ["src", "packages/scratch-core/src"]
omit = ["src/main.py"]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
[tool.deptry.per_rule_ignores]
DEP002 = ["opencv-python"] # import cv2 is not recognized as opencv-python
DEP003 = ["mutations"] # part of scratch-core