Files
mantelo/pyproject.toml
Lucy Linder 022b4d72ac
Build & Test / build (push) Has been cancelled
Release Please / release-please (push) Has been cancelled
Release Please / publish (push) Has been cancelled
chore: use ruff directly and apply it to tests
Get rid off divio/lint, and use ruff directly. This makes the config obvious.
Also ensure the tests/ folder is linted, and fix all the lint issues at the
same time.

This should have no impact whatsoever.
2026-08-29 19:16:41 +02:00

189 lines
4.3 KiB
TOML

[build-system]
requires = [
"setuptools>=61.0",
"setuptools-scm[toml]>=6.2",
"wheel",
]
build-backend = "setuptools.build_meta"
[project.urls]
Homepage = "https://github.com/derlin/mantelo"
Documentation = "https://mantelo.readthedocs.io/en/latest/"
Source = "https://github.com/derlin/mantelo"
"Issue tracker" = "https://github.com/derlin/mantelo/issues"
Changelog = "https://github.com/derlin/mantelo/CHANGELOG.md"
[project]
dynamic = ["version"] # see setuptools_scm
name = "mantelo"
description = "✨ Keycloak Admin REST Api Client for Python ✨"
license = { file = "LICENSE" }
authors = [{ name = "Lucy Linder", email = "lucy.derlin@gmail.com" }]
readme = "README.md"
keywords = ["keycloak", "http", "rest", "requests", "client"]
classifiers = [
"Intended Audience :: Developers",
"Environment :: Web Environment",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries",
"Topic :: Utilities",
]
requires-python = ">=3.10"
dependencies = [
"attrs",
"requests",
]
[project.optional-dependencies]
dev = [
"build",
"ruff",
"coverage",
"tox",
"mypy",
"check-manifest",
"types-requests",
"types-slumber",
]
test = [
"pytest",
"pytest-cov",
]
docs = [
"sphinx",
"sphinx-book-theme",
"sphinx-autoapi",
"sphinx-copybutton",
"sphinxext-opengraph",
]
[tool.setuptools]
platforms = ["any"]
[tool.setuptools.packages.find]
# Do not include tests in the wheel, as they
# require keycloak anyway
exclude=['tests*']
[tool.check-manifest]
ignore = [
"mantelo/version.py",
"codecov.yml",
"docker-compose.yml",
"Makefile",
"tox.ini",
"CONTRIBUTING.md",
"CODEOWNERS",
".readthedocs.yaml",
".release-please-manifest.json",
"docs/**",
]
[tool.setuptools_scm]
write_to = "mantelo/version.py"
[tool.ruff]
line-length = 79
target-version = "py310" # lowest supported version
[tool.ruff.lint]
# S101 (assert used) is deliberately not selected: we allow asserts.
select = [
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"YTT", # flake8-2020 (usage of sys package)
"S110", # try-except-pass detected, consider logging the exception
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"PIE", # flake8-pie (misc lints)
"T20", # flake8-print
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RET", # flake8-return
"SIM", # flake8-simplify
"DTZ", # flake8-datetimez (token expiry relies on aware datetimes)
"LOG", # flake8-logging
"G", # flake8-logging-format
"PERF", # perflint
"PLE", # pylint ("E" subset)
"PLW", # pylint ("W" subset)
"FLY", # static join to f-string
"RUF", # ruff miscellaneous lints
]
ignore = [
"E501", # line too long (the formatter owns line length)
"B904", # raise-without-from-inside-except
"RET505", # superfluous else return
"PLW2901", # redefined loop name
"RUF012", # mutable class default
# Tests assert on the exception message via `excinfo.value`, which is
# stricter than `match=`, so requiring `match=` would be a step back.
"PT011", # pytest.raises too broad
# conflicts with the ruff formatter
"W191",
"ISC001",
"ISC002",
]
[tool.ruff.lint.isort]
lines-after-imports = 2
lines-between-types = 0
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
"NOCOV",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
"raise AssertionError",
"raise NotImplementedError",
]
precision = 2
[tool.coverage.html]
directory = ".artifacts/htmlcov"
[tool.coverage.xml]
output = ".artifacts/coverage.xml"
[tool.coverage.run]
branch = true
relative_files = true
source = ["."]
data_file = ".artifacts/.coverage"
omit = ["mantelo/version.py"]
[tool.pytest.ini_options]
markers = ["integration"]
[tool.mypy]
python_version = "3.10"