Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
134 lines (115 loc) · 3.03 KB
/
Copy pathpyproject.toml
File metadata and controls
134 lines (115 loc) · 3.03 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
[project]
name = "unsupervised-bias-detection"
version = "1.0.0"
description = "Unsupervised detection of bias in data."
readme = "README.md"
requires-python = ">=3.11"
license = "EUPL-1.2 license"
authors = [
{name = "NGO Algorithm Audit", email = "info@algorithmaudit.eu"}
]
dependencies = [
"kmodes>=0.12.2",
"numpy>=2.4.3",
"scikit-learn>=1.8.0",
]
[project.urls]
"Repository" = "https://github.com/NGO-Algorithm-Audit/unsupervised-bias-detection"
[dependency-groups]
dev = [
"fairlearn>=0.13.0",
"pandas>=3.0.1",
"pytest>=9.0.2",
"ruff>=0.15.5",
]
[tool.pytest.ini_options]
testpaths = ["tests", "unsupervised_bias_detection/cluster"]
addopts = "--verbose --showlocals --full-trace --color=yes --doctest-modules"
[tool.ruff]
# Set the maximum line length to 88 (Black's default)
line-length = 88
# Assume Python 3.12+
target-version = "py312"
# Exclude common directories
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"__pycache__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
[tool.ruff.lint]
# Enable these rule categories
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"ARG", # flake8-unused-arguments
"SIM", # flake8-simplify
"NPY", # NumPy-specific rules
"PD", # pandas-vet
"RUF", # Ruff-specific rules
"D", # pydocstyle (docstring conventions)
]
# Disable specific rules if needed
ignore = [
"D202", # no blank lines allowed after docstring
"D203", # 1 blank line required before class docstring (conflicts with D211)
"D212", # multi-line docstring summary should start at first line (conflicts with D213)
]
# Allow autofix for all enabled rules (when `--fix` is provided)
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.per-file-ignores]
# Ignore specific rules in specific files
"__init__.py" = ["F401"] # unused imports in __init__.py
"tests/**/*.py" = [
"S101", # use of assert detected
"ARG", # unused function arguments
"FBT", # boolean trap
]
[tool.ruff.lint.isort]
# Configure import sorting
known-first-party = ["unsupervised_bias_detection"]
force-sort-within-sections = true
split-on-trailing-comma = false
[tool.ruff.lint.mccabe]
# Set complexity threshold
max-complexity = 10
[tool.ruff.format]
# Use double quotes for strings
quote-style = "double"
# Indent with spaces
indent-style = "space"
# Respect magic trailing commas
skip-magic-trailing-comma = false
# Auto-format docstrings
docstring-code-format = true
# Line ending style
line-ending = "auto"