[build-system]
requires = ["pbr>=6.1.1"]
build-backend = "pbr.build"

[project]
name = "openstacksdk"
description = "An SDK for building applications to work with OpenStack"
authors = [
    {name = "OpenStack", email = "openstack-discuss@lists.openstack.org"},
]
readme = {file = "README.rst", content-type = "text/x-rst"}
license = "Apache-2.0"
dynamic = ["version", "dependencies"]
requires-python = ">=3.11"
classifiers = [
    "Environment :: OpenStack",
    "Intended Audience :: Information Technology",
    "Intended Audience :: System Administrators",
    "Operating System :: POSIX :: Linux",
    "Programming Language :: Python",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
]

[project.urls]
Homepage = "https://docs.openstack.org/openstacksdk"
Repository = "https://opendev.org/openstack/openstacksdk/"

[project.scripts]
# TODO(mordred) Move this to an OSC command at some point
openstack-inventory = "openstack.cloud.cmd.inventory:main"

[tool.setuptools.packages.find]
include = ["openstack"]

[tool.mypy]
python_version = "3.11"
show_column_numbers = true
show_error_context = true
follow_imports = "normal"
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
extra_checks = true
no_implicit_reexport = true
strict_bytes = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
disable_error_code = ["import-untyped"]
exclude = "(?x)(doc | examples | releasenotes)"

[[tool.mypy.overrides]]
module = [
    "openstack._hacking.*",
    "openstack.cloud.*",
    "openstack.tests.functional.*",
]
disable_error_code = ["import-untyped", "func-returns-value"]
disallow_untyped_calls = false
disallow_untyped_defs = false
warn_return_any = false

[[tool.mypy.overrides]]
module = ["openstack.tests.unit.*"]
ignore_errors = true

[tool.ruff]
line-length = 79

[tool.ruff.format]
quote-style = "preserve"
docstring-code-format = true

[tool.ruff.lint]
select = ["E4", "E5", "E7", "E9", "F", "RUF", "S", "UP", "W"]
ignore = [
    # there are a lot of these to fix
    "RUF012",
    # we only use asserts for type narrowing
    "S101",
]
external = ["H"]

[tool.ruff.lint.per-file-ignores]
"openstack/tests/*" = ["S"]
"openstack/_services_mixin.py" = ["E501"]
"examples/*" = ["S"]
