git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/pyproject.toml
blob: 803a5cd6fb858f5d0ca25264905df89621a15fe0 (plain)
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
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "project-dummy"
description = "A dummy as base directory for actual projects"
authors = [
	{ name = "Glenn Matthews", email = "mail_redacted_for_web" }
]
license = { text = "License :: OSI Approved :: GNU General Public License v2 (GPLv2)" }
readme = "README.md"
requires-python = ">=3.6.0"
dependencies = [
	"ansible",
	"ansible-compat",
	"ansible-core>=2.12.0"
]
dynamic = ["version"]

[project.scripts]
# install a command as part of the package
hemlo = "project_dummy:hemlo_world"

[project.urls]
Source = "https://git.lirion.de/python-project-dummy"
Documentation = "https://wiki.lirion.example.com/python-project-dummy"

[tool.pytest.ini_options]
# both mode and loop fixture see https://github.com/pytest-dev/pytest-asyncio/issues/924
asyncio_mode = "auto"
# Valid fixture loop scopes are: "function", "class", "module", "package", "session"
# Caution: This works only on "more recent" versions of pytest (7.2.1 doesn't know this, 8.3.3 does)
asyncio_default_fixture_loop_scope = "function"

[tool.ruff]
# Assume Python 3.6.
target-version = "py36"
fix = true
show-fixes = true
preview = true

[tool.ruff.lint]
select = [
    "E",     # pycodestyle
    "F",     # Pyflakes
    "I001",  # isort
    "UP",    # pyupgrade
    "ASYNC", # flake8-async
    "C4",    # flake8-comprehensions
    "T10",   # flake8-debugger
    "FA",    # flake8-future-annotations
    "PT",    # flake8-pytest-style
    "RSE",   # flake8-raise
    "PERF",  # Perflint
    "FURB",  # refurb
]
ignore = [
    "E501"  # https://www.flake8rules.com/rules/E501.html - Let `black` handle this.
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
    "venv*",
    "tests"
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = [
    "I001",
]

[tool.ruff.lint.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
# Needed for python < 3.10, should be removed afterward.
keep-runtime-typing = true

[tools.setuptools.dynamic]
version = {attr = 'project_dummy.__version__'}
readme = {file = ['README.md', 'README.rst', 'USAGE.rst']}
classifiers = {file = ['classifiers.txt']}
# # dependencies supports "file" but does not support comments in requirements.txt ... :|
# dependencies = {file = ['requirements.txt']}
# # ...same for optional dependencies...
# optional-dependencies = {file = ['requirements.txt']}

# look for packages:
[tools.setuptools.packages.find]
# Not using "src/" for now. I'm starting with /package_name folders, using "src" as a folder
# feels redundant. May change when I use larger projects.
# where = ["src"]  # list of folders that contain the packages (["."] by default)
include = ["project_*"]  # package names should match these glob patterns (["*"] by default)
exclude = ["project_*.tests*"]  # exclude packages matching these glob patterns (empty by default)
namespaces = false  # to disable scanning PEP 420 namespaces (true by default)

# ...or list the packages explicitly:
# [tool.setuptools]
# packages = ["my_package"] # use [] for meta-dists that just collect dependencies