-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
151 lines (142 loc) · 4.39 KB
/
pyproject.toml
File metadata and controls
151 lines (142 loc) · 4.39 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
147
148
149
150
151
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[project]
name = "lir"
description = "Package for optimising and evaluating Likelihood Ratio (LR) systems."
dynamic = ["version"]
authors = [
{name = "Netherlands Forensics Institute", email = "netherlandsforensicinstitute@users.noreply.github.com"}, ]
requires-python = ">=3.12,<3.15"
readme = "README.md"
license = {text = "Apache Software License 2.0"}
dependencies = [
"confidence>=0.17.1",
"matplotlib>=3.5",
"numpy>2",
"scikit-learn>=1.2",
"tqdm>=4.67.1",
"optuna>=4.4.0",
"scipy>=1.13.1",
"KDEpy>=1.1.12",
"pydantic>=2.12.3",
"requests-cache>=1.2.1",
"jsonschema>=4.26.0",
"numba>=0.63",
"pymc>=5.21.0",
]
[project.urls]
homepage = "https://github.com/NetherlandsForensicInstitute/lir/"
[project.scripts]
lir = "lir.main:main"
[dependency-groups]
dev = [
"coverage",
"pytest",
"pytest-testmon>=2.1.3",
"mypy>=1.18.2",
"ruff>=0.14.3",
"scipy-stubs>=1.17.0.0",
"sphinx>=9.0.4",
"sphinx-rtd-theme>=3.1.0",
"sphinxcontrib-napoleon>=0.7",
"sphinx-jinja>=2.0.2",
"myst-parser>=5.0.0",
"jupyter-sphinx>=0.5.3",
"types-requests>=2.32.4.20250913",
"numpydoc>=1.10.0",
]
[tool.pdm]
version = {source = "scm"}
[tool.pdm.scripts]
all = {composite = ["check", "test"]}
all_with_quicktest = {composite = ["check", "quicktest"]}
check = {composite = ["format-check", "lint", "mypy", "lint-docs"]}
fix-all = {composite = ["lint-fix", "format-fix"]}
lint = "ruff check lir tests docs"
lint-fix = "ruff check --fix lir tests docs"
format-check = "ruff format --diff lir tests docs"
format-fix = "ruff format lir tests docs"
mypy = "mypy lir"
# If no args are given to 'test', this will run as if '{args}' is an empty string.
test = "coverage run --branch --source lir --module pytest --strict-markers -W error::RuntimeWarning tests/ {args}"
quicktest = {composite = ["test --testmon"]}
test-coverage = "coverage report"
lir = "python -m lir"
lint-docs = {shell = 'numpydoc lint lir/*.py lir/*/*.py'}
apidoc = "sphinx-apidoc -f -e -M -o docs/api lir"
generate-docs = {composite = ["apidoc", "sphinx-build -M html docs build"]}
serve-docs = {composite = ["generate-docs", "python -m http.server -d build/html"]}
[tool.ruff]
format.quote-style = "single"
line-length = 120
lint.flake8-builtins.ignorelist = ["format"]
lint.flake8-quotes.inline-quotes = "single"
lint.ignore = [
# enforced by the formatter, not ignoring this causes warnings
"COM812",
# 'r' is the default mode for builtin open(), but explicit is better than implicit
"UP015",
# `X` as variable name is allowed to be uppercase in this project
"N802", "N803", "N806",
# allow `open()` over `Path.open()`
"PTH123",
# allow raising custom Exceptions in try/catch blocks
"B904",
# do not enforce use of all() inside `for()` loop
"SIM110",
# do not enforce a docstring for each module
"D100", "D104",
# allow undocumented magic methods (e.g. `__call___`)
"D105",
# do not enforce writing doc strings for `__init__()` methods
"D107",
]
lint.isort.lines-after-imports = 2
# List of enabled linting rules, for a complete
# overview, see: https://docs.astral.sh/ruff/rules
lint.select = [
"A", # flake8-builtins
"B", # flake8-bugbear
"D", # pydocstyle
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"E", # pydocstyle-error
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"PD", # pandas-vet
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"SIM", # flake8-simplify
"UP", # pyupgrade
"S", # bandit
"PIE", # flake8-pie
]
lint.per-file-ignores = {"tests/*" = [
"D", # Ignore missing docstrings in tests.
"S101", # Allow use of assert in tests.
]}
lint.pydocstyle.convention = "numpy"
[tool.mypy]
# allow redefinition of inferred / assigned types
allow_redefinition = true
# require all defined functions to be fully typed
allow_incomplete_defs = false
allow_untyped_defs = false
# be strict about optional types
strict_optional = true
# warn about lines in this file that make no sense to mypy
warn_unused_configs = true
# do not warn about missing imports
ignore_missing_imports = true
[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
"GL08",
"EX01",
"SA01",
"ES01",
"GL01",
]