-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
281 lines (247 loc) · 8.97 KB
/
Copy pathpyproject.toml
File metadata and controls
281 lines (247 loc) · 8.97 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# Check this for proper formatting: https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata
[project]
name = "vr2f"
version = "1.0.0"
description = "EEG-decodability of facial expressions and their stereoscopic depth cues in immersive virtual reality."
readme = "README.md"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [
{ name = "Felix Klotzsche", email = "klotzsche@cbs.mpg.de" },
]
maintainers = [
{ name = "Felix Klotzsche", email = "klotzsche@cbs.mpg.de" },
]
keywords = ["virtual reality", "EEG", "face processing", "stereoscopic depth"]
# Check for classifiers: https://pypi.org/classifiers/
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]
# Similar to a requirements.txt file, fill in the dependencies your project requires
# Install the project code as Python module with `pip install -e .`
dependencies = [
"ipykernel==6.29.5",
"toml==0.10.2",
"mne==1.2.3",
"autoreject==0.4.3",
"ipython==8.12.3",
"matplotlib==3.10.5",
"numpy==2.3.2",
"pandas==1.4.3",
"scikit_learn==1.7.1",
"scipy==1.16.1",
"seaborn==0.13.2",
"setuptools==71.0.4",
"statsmodels==0.14.2",
"tqdm==4.66.4",
]
# Following can be co-installed with `pip install -e .[develop]`
[project.optional-dependencies]
develop = [
"black[jupyter]>=24.2.0",
"ruff>=0.3.1",
"tox>=4.12.1",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
]
[project.urls]
repository = "https://github.com/eioe/vr2f"
data = "https://doi.org/10.17617/3.CQ2VXX"
# Entry points for the project
# For a command line interface (CLI) [uncomment and/or adopt the following if needed]
# [project.scripts]
# vr2f = "vr2f.main:main"
[tool.setuptools]
platforms = [
"unix",
"linux",
"osx",
"cygwin",
"win32",
] # TODO: keep only intended platforms
zip-safe = false
# To automatically find the package(s) (Beta feature (Oct, 2022)):
[tool.setuptools.packages.find]
where = ["code"]
include = [
"vr2f",
"vr2f.*",
]
exclude = ["tests", "notebooks", "configs"]
# Include non-python files in the package (uncomment if needed)
# [options.package_data]
# vr2f = ["*.txt", "*.rst"]
# Exclude specific non-python files in the package (uncomment if needed)
# [tool.setuptools.exclude-package-data]
# vr2f = [".gitattributes"]
# ALL ABOVE IS AN ADAPTATION OF THE FORMER setup.cfg
# ALL BELOW WAS ALREADY PART OF pyproject.toml [Oct, 2022]
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[tool.pytest.ini_options]
#addopts = "--cov=vr2f"
testpaths = ["code/tests"]
[tool.mypy]
mypy_path = "code"
check_untyped_defs = true
disallow_any_generics = true
ignore_missing_imports = true
no_implicit_optional = true
show_error_codes = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
no_implicit_reexport = true
[tool.coverage.run] # https://coverage.readthedocs.io/en/latest/config.html
data_file = "code/tests/.coverage"
[tool.coverage.report]
exclude_lines = ["if __name__ == .__main__.:", "if TYPE_CHECKING:", "@abstract"]
[tool.coverage.html]
directory = "code/tests/coverage_html_report"
[tool.ruff]
# Select rules / linters to apply
lint.select = [ # add /comment-out rules (list below does not contain all rules)
# "ALL", # all rules
"D", # pydocstyle
"E", # pycodestyle [default]
"F", # Pyflakes [default]
"I", # isort imports
"RUF", # ruff specific
"UP", # pyupgrade [default]
"W", # pycodestyle: warning
"C90", # mccabe
"N", # pep8-naming
# "ANN", # flake8-annotations (toggle on if you intend to work with type annotations)
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
# "EM", # flake8-errmsg
# "FA", # flake8-future-annotations (see ANN above)
"ISC", # flake8-implicit-str-concat
# "ICN", # flake8-import-conventions
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"TD", # flake8-todos
"FIX", # flake8-fixme
"ERA", # eradicate
"PD", # pandas-vet
"PL", # Pylint
"NPY", # NumPy-specific rules
] # run `ruff linter` to see all rules; ; run e.g., `ruff rule ERA001` to see specs of specific rule
fix = false # true: Ruff will try to fix certain errors automatically
# List of rules to consider non-autofix-able.
lint.unfixable = [ # either with fix = true or when `ruff . --fix` is executed
"ERA001", # found commented-out code
"F401", # unused imports
"RUF100", # `noqa` directives that are no longer applicable
]
# Ignore specific rules (e.g., "ANN102") or the whole set of a rule (e.g., "ANN")
lint.ignore = [
"ANN101", # flake8-annotations: Missing type annotation for self in method
"ANN102", # flake8-annotations: Missing type annotation for cls in classmethod
"ANN401", # flake8-annotations: Any
"COM812", # Trailing comma missing
"D203", # 1 blank line required before class docstring: incompatible with D211 (=no blank line required)
"D212", # multi-line-summary-first-line incompatible with D213 (=should start at second line)
"DTZ005", # timezone-naive datetime
"E402", # Module level import not at top of file (covert by ISORT)
# "E501", # Ignore line-length since we use 119
# "ERA001", # Found commented-out code
"ISC001", # single-line-implicit-string-concatenation [toogle if you use `ruff format`]
"S301", # suspicious-pickle-usage
"TD002", # Missing author in To-Do
"TD003", # Missing issue link on the line following a To-Do
"RET504", # Unnecessary variable assignments preceding a return
]
lint.ignore-init-module-imports = true # void automatically removing unused imports in __init__.py
respect-gitignore = true # files & folder ignored in gitignore are ignored by ruff as well [default: true]
src = ["code/vr2f", "code/notebooks", "code/tests"]
include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]
# Exclude a variety of commonly ignored directories:
extend-exclude = [
"code/configs",
"data",
"literature",
"organisation",
"publications",
"results",
]
line-length = 119 # same as flake8 & black
target-version = "py311" # assume Python 3.11
# output-format = "grouped" # default : "text"
# preview = true # true: Ruff will use unstable rules and fixes; default: false
# Ignore specific rules in specific files
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["F401", "D104"]
"*.ipynb" = ["D100"] # ignore docsstring in notebooks
"code/tests/*.py" = ["S101", "PLC2701", "N802"] # ignore assert statements in tests, private name imports, & lowercase (tearDown, setUp)
[tool.ruff.format]
# Check: https://docs.astral.sh/ruff/settings/#format
# quote-style = "single" # default: "double"
# indent-style = "tab" # Use tabs instead of 4 space indentation.
# skip-magic-trailing-comma = true # default: false
docstring-code-format = true # default: false
# docstring-code-line-length = 80
# preview = true # true: Ruff will use unstable rules for formatting; default: false
# Configure specific linters
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
ignore-fully-untyped = true
suppress-none-returning = true
[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true
[tool.ruff.lint.flake8-type-checking]
# quote-annotations = true # default: false
[tool.ruff.lint.isort]
known-local-folder = ["code/vr2f"]
# known-first-party = ...
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds x.
max-complexity = 10 # default x: 10
[tool.ruff.lint.pep8-naming]
ignore-names = ["X"] # fill with specific class, function, variable names
[tool.ruff.lint.pydocstyle]
# convention = "numpy" # "google" # , "pep257"
[tool.ruff.lint.pylint]
max-args = 10 # default: 5
max-branches = 12 # default: 12
max-locals = 15 # default: 15
max-returns = 6 # default: 6
max-statements = 100 # default: 50
max-nested-blocks = 5 # default: 5
# allow-magic-value-types = ["int"]
[tool.black]
line-length = 119
target-version = ["py311"]
src = ["code/vr2f", "code/notebooks", "code/tests"]
include = '(\.pyi?|\.ipynb)$'
exclude = ''' # A regex preceded with ^/ will apply only to files and directories in the root of the project.
(
^/code/configs
| ^/data
| ^/literature
| ^/organisation
| ^/publications
| ^/results
| /*/\..* # ignore (hidden) files in hidden directories
)
'''
# preview = true # include unstable / upcoming black features