[build-system]
requires = ["setuptools", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"


[project]
name = "ka_uts_obj"
description = "Object Management"
license = "GPL-3.0-only WITH Classpath-Exception-2.0 OR BSD-3-Clause"
license-files = ["LICENSE.txt"]
requires-python = ">=3.11"
dynamic = ["readme", "classifiers", "version", "dependencies"]
authors = [
    {name = "Bernd Stroehle", email = "bernd.stroehle@bs29.com"}
]
maintainers = [
    {name = "Bernd Stroehle", email = "bernd.stroehle@bs29.com"}
]

[project.urls]
"Source Code" = "https://github.com/bs29/ka_uts_obj/tree/master"
"Homepage" = "https://kosakya.de/"
"Documentation" = "https://ka-apc.readthedocs.io/en/latest"
# "Documentation" = "https://bs29.atlassian.net/wiki/spaces/SD/pages/164074/ka+apc"
# "Bug Tracker" = "https://kosakya.de/issues"
# "Changelog" = "https://kosakya.de/ka_uts_obj/blob/master/CHANGELOG.md"
"Apache-2.0 License" = "https://apache.org/licenses/LICENSE-2.0"
"GPLv3 License" = "https://www.gnu.org/licenses/gpl-3.0.en.html"


[tool.setuptools]
zip-safe = false
include-package-data = true

# [tool.setuptools.packages]
# find = {namespaces = true}
# namespace_packages = ka_uts_obj

[tool.setuptools.package-data]
"*" = ["*.*"]

[tool.setuptools.packages.find]
# where = ["."]  # list of folders that contain the packages (["."] by default)
# include = ["ka_uts_obj*"]  # package names should match these glob patterns (["*"] by default)
exclude = [
    "*.tests*",
    "__pycache__*"  # exclude packages matching these glob patterns (empty by default)
]
namespaces = true  # to disable scanning PEP 420 namespaces (true by default)

[tool.setuptools.dynamic]
version = {attr = "ka_uts_obj.__version__.__version__"}
readme = {file = "README.rst"}
dependencies = {file = ["requirements.txt"]}
classifiers = {file = ["classifiers.txt"]}


[tool.black]
line-length = 88
target-version = ['py312']
include = '\\.pyi?$'
# 'extend-exclude' excludes files or directories in addition to the defaults
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
force-exclude = '''
(
    __pycache__*
)
'''


[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--tb=short --cov=astronomer --cov-report=xml"
testpaths = [
    "tests",
]


[tool.mypy]
namespace_packages = true
explicit_package_bases = true
pretty = true
show_error_codes = true
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
show_error_context = true
color_output = true
disallow_any_generics = true
disallow_untyped_defs = false
disallow_incomplete_defs = false
warn_unused_configs = true
warn_unused_ignores = true
warn_return_any = true
strict_equality = true
allow_untyped_globals = true

# mypy per-module options:
[[tool.mypy.overrides]]
module = [
    "airflow",
    "asgiref"
]
ignore_missing_imports = true


[tool.pydocstyle]
inherit = false
add_ignore = "D100,D104,D105,D107,D205,D400,D401"
convention = "pep257"


[tool.ruff]
lint.per-file-ignores = {"__init__.py" = ["F403"]}
# select = ["E", "F", "RUF", "UP", "W"]
lint.select = [
    "E",  # pycodestyle errors
    "W",  # pycodestyle warnings
    "F",  # pyflakes
    # "I",  # isort
    "C",  # flake8-comprehensions
    "B",  # flake8-bugbear
]
lint.ignore = [
    'E401', # Multiple imports on one line
    'E402', # Module level import not at top of file
    'E501', # Never enforce line length violations
    'E731', # Do not assign a lambda expression, use a def
    'E741', # Ambiguous variable name: I
    'E741', # Ambiguous variable name: I
    'RUF001',
    'RUF005',
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
# fixable = ["A", "B", "C", "D", "E", "F", "..."]
lint.fixable = ["A", "B", "C", "D", "E", "F"]
lint.unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
    "__pycache__",
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".hg",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "dist",
    "node_modules",
    "venv",
]

# Same as Black.
line-length = 88

# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.11.
target-version = "py311"

# [tool.ruff.lint.pyupgrade]
# keep-runtime-typing = true

[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10

[tool.ruff.lint.isort]
# "profile" = "black"
# "multi_line_output" = 3
# ignore_missing_imports = true
# combine-as-imports = true
# known-first-party = ["astronomer", "tests"]
# # TODO: for now, https://github.com/charliermarsh/ruff/issues/1817
# known-third-party = ["google", "gcloud"]

# [tool.isort]
# profile = "black"
# multi_line_output = 3
# ignore_missing_imports = true


[tool.sphinx-pyproject]
github_username = "ka_uts_obj"
github_repository = "ka_uts_obj"
author = "Bernd Stroehle"
project = "sphinx-pyproject"
copyright = "2021-2024 Bernd Stroehle"
language = "en"
package_root = "ka_uts_obj"
