Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
107 lines (93 loc) · 3.29 KB
/
Copy pathpyproject.toml
File metadata and controls
107 lines (93 loc) · 3.29 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
# Copyright 2026 Samvel Khalatyan. All rights reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
[project]
name = "lab"
version = "0.0.0"
description = "R&D Lab"
readme = "README.md"
requires-python = ">=3.14,<4.0"
license = "BSD-3-Clause"
authors = [{ name = "Samvel Khalatyan", email = "sn.khalatyan@gmail.com" }]
[project.urls]
repository = "https://github.com/skhal/lab"
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
package-mode = false # use poetry only for dependency management
# Linters and type checkers for CI: poetry install --with lint
# Local development uses system packages (Homebrew, pkg) instead: PyPI has no
# FreeBSD wheels, so Poetry would build these from source.
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
# keep-sorted start
pyrefly = "1.5.1"
ruff = "0.17.6"
# keep-sorted end
# Repository-wide Ruff config. Python projects, such as ansible/ and
# poetry/plugin/patch, keep their own pyproject.toml and environment, and
# pick up this config because they have no [tool.ruff].
[tool.ruff]
indent-width = 4
line-length = 80
# Ansible modules and module_utils run on the managed hosts with FreeBSD
# default python3, see style/python.md. Keep the version and the patterns in
# sync with check/py-typecheck-hosts. Ruff * also matches /, so the tests that
# mirror these paths get the same target version.
[tool.ruff.per-file-target-version]
"ansible/*/library/*.py" = "py312"
"ansible/*/module_utils/*.py" = "py312"
"ansible/*/plugins/modules/*.py" = "py312"
[tool.ruff.format]
indent-style = "space"
[tool.ruff.lint]
# DOC rules are in preview. Enable only the preview rules listed by full code.
explicit-preview-rules = true
preview = true
extend-select = [
# pydoclint: Returns, Yields, and Raises sections match the code. DOC502
# stays off: Raises lists exceptions callers may see, including propagated.
# keep-sorted start
"DOC201", # docstring-missing-returns
"DOC202", # docstring-extraneous-returns
"DOC402", # docstring-missing-yields
"DOC403", # docstring-extraneous-yields
"DOC501", # docstring-missing-exception
# keep-sorted end
]
ignore = [
"UP035", # import from collections.abc: noisy in existing code
]
select = [
"ANN", # flake8-annotations, not in tests
"B", # flake8-bugbear
"D", # pydocstyle, see convention below
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"N", # pep8-naming
"PL", # Pylint
"RUF", # Ruff-specific rules
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]
[tool.ruff.lint.isort]
known-first-party = ["poetry_plugin_patch"]
[tool.ruff.lint.per-file-ignores]
# __init__.py files re-export names.
"**/__init__.py" = ["D", "F401"]
# Tests do not need docstrings or annotations. Pylint refactor checks do not
# fit tests: fakes branch on many inputs and assertions compare to literals.
"**/tests/**" = ["ANN", "D", "DOC", "PLR"]
"**/*_test.py" = ["ANN", "D", "DOC", "PLR"]
"**/test_*.py" = ["ANN", "D", "DOC", "PLR"]
"**/conftest.py" = ["ANN", "D", "DOC", "PLR"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pydoclint]
# Google style allows a one-line docstring for simple functions.
ignore-one-line-docstrings = true