-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
156 lines (143 loc) · 3.79 KB
/
Copy pathpyproject.toml
File metadata and controls
156 lines (143 loc) · 3.79 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
152
153
154
155
156
[build-system]
requires = ["setuptools >= 64", "setuptools_scm >= 8"]
build-backend = "setuptools.build_meta"
[project]
name = "src"
description = "Package for storing reusable functions and classes during experimentations."
authors = [
{ name = "Guillem Hurault" },
]
readme = "README.md"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
]
dependencies = []
requires-python = ">=3.10"
dynamic = ["version"]
[project.optional-dependencies]
# Additional dependencies
analysis = [
"matplotlib",
"numpy",
"pandas",
"plotnine",
]
dev = [
"black",
"ipykernel",
"ipywidgets",
"pdoc",
"pre-commit",
"pytest",
"pytest-cov",
"ruff",
"sqlfluff",
"typos",
"uv",
]
all = ["src[analysis,dev]"]
[project.urls]
# Homepage = ""
# Documentation = ""
# Repository = ""
# Issues = ""
[tool.setuptools_scm]
[tool.pyright]
typeCheckingMode = "standard"
exclude = ["**/.*", "**/__pycache__", "**/node_modules", "data"] # Mostly for CLI
reportUnnecessaryTypeIgnoreComment = false # Can have discrepancy between CLI and Language Server if set to true
[[tool.pyright.executionEnvironments]]
# Override settings for analysis directory (since not possible to have a separate typeCheckingMode)
root = "analysis"
reportMissingImports = false
reportWildcardImportFromLibrary = false
reportAttributeAccessIssue = false
reportArgumentType = false
reportUnusedExpression = false
reportCallIssue = false
reportFunctionMemberAccess = false
reportIncompatibleMethodOverride = false
reportIncompatibleVariableOverride = false
reportOverlappingOverload = false
reportPossiblyUnboundVariable = false
[tool.ruff.lint]
select = [
"A", # builtins
"B", # flake8-bugbear
"C4", # comprehensions
"C90", # McCabe cyclomatic complexity
"D", # pydocstyle
"E", # pycodestyle error
"F", # pyflakes
"FURB", # modernising Python codebase
"I", # isort
"ICN", # import conventions
"N", # PEP8 naming
"NPY", # numpy
"PD", # pandas
"PERF", # performance
"PGH004", # Use specific rules in noqa
"PIE790", # Unnecessary placeholders
"PLC", # pylint convention
"PLE", # pylint error
"PLR", # pylint refactoring
"PLW", # pylint warning
"RUF", # ruff specific rules
"S", # bandit (security issues)
"SIM", # flake8-simplify
"TID", # Tidy imports
"TRY300", # Use else block in try-except
"UP", # pyupgrade
"W", # pycodestyle warning
]
ignore = [
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D107", # Missing docstring in __init__
"D202", # Blank line after function docstring
"E501", # Avoid enforcing line-length violations
"PD015", # Use pd.merge
"PERF203", # Try-except in loop
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402"] # Ignore import violations
"analysis/*" = [
"B018", # Useless expression
"B028", # No explicit stacklevel for warnings
"D101", # Missing docstring in public class
"F403", # Use of wildcard imports
"F405", # Undefined names because of wildcard imports
"PLR2004", # Magic values
"S", # Disable bandit on analysis files
]
"tests/*" = [
"D100", # Undocumented public module
"D101", # Missing docstring in public class
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 7
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["X", "X_*"]
[tool.ruff.lint.isort]
known-first-party = [
"src",
] # Add others local/private packages
known-local-folder = [
"_local_helpers",
] # Use this convention to treat module in analysis directories as local
[tool.pytest.ini_options]
testpaths = ["src", "tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"--color=yes",
"--cov-report=term-missing",
"--cov=src",
"--cov=tests",
"--doctest-modules"
]
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"