[project]
name = "asyncua"
version = "1.1.8"
description = "Pure Python OPC-UA client and server library"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "GNU Lesser General Public License v3 or later" }
authors = [
  { name = "Olivier Roulet-Dubonnet", email = "olivier.roulet@gmail.com" },
]
classifiers = [
  "Development Status :: 4 - Beta",
  "Intended Audience :: Developers",
  "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
  "Operating System :: OS Independent",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
  "aiofiles",
  "aiosqlite",
  "cryptography>42.0.0",
  "pyOpenSSL>23.2.0",
  "python-dateutil",
  "pytz",
  "sortedcontainers",
  "typing-extensions",
  "wait_for2==0.3.2;python_version<'3.12'",
]

[project.urls]
Homepage = "http://freeopcua.github.io/"
Repository = "https://github.com/FreeOpcUa/opcua-asyncio"

[project.scripts]
uabrowse = "asyncua.tools:uals"
uacall = "asyncua.tools:uacall"
uaclient = "asyncua.tools:uaclient"
uadiscover = "asyncua.tools:uadiscover"
uageneratestructs = "asyncua.tools:uageneratestructs"
uahistoryread = "asyncua.tools:uahistoryread"
uals = "asyncua.tools:uals"
uaread = "asyncua.tools:uaread"
uaserver = "asyncua.tools:uaserver"
uasubscribe = "asyncua.tools:uasubscribe"
uawrite = "asyncua.tools:uawrite"

[dependency-groups]
dev = [
  "asynctest",
  "coverage",
  "mypy",
  "pytest",
  "pytest-asyncio",
  "pytest-cov",
  "pytest-mock",
  "pytest-repeat",
  "ruff",
  "types-aiofiles",
  "types-cryptography",
  "types-pyOpenSSL",
  "types-python-dateutil",
  "types-pytz",
  "wait_for2",
]
lint = ["mypy", "pre-commit", "ruff"]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.sdist]
include = ["/asyncua"]

[tool.mypy]
disable_error_code = ["misc", "arg-type", "assignment", "var-annotated"]
check_untyped_defs = false
mypy_path = "./stubs"

[[tool.mypy.overrides]]
# Autogenerated file
module = "asyncua.ua.uaprotocol_auto.*"
disable_error_code = "literal-required"

[[tool.mypy.overrides]]
module = "asyncua.client.*"
check_untyped_defs = true

[[tool.mypy.overrides]]
module = "asynctest.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "aiosqlite.*"
ignore_missing_imports = true

[tool.pytest.ini_options]
log_cli = false
log_level = "INFO"
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_test_loop_scope = "module"
asyncio_default_fixture_loop_scope = "module"

[tool.ruff]
line-length = 120
extend-exclude = [
  "docs",
  "nodeset",
  "schemas",
  "*_auto.py",
  "event_objects.py",
  "standard_address_space_services.py",
]

[tool.ruff.lint]
select = [
  "E",
  "F",
  "G004",
  "W",
  "UP",
  "YTT",
  "ASYNC",
  "T10",
  "ISC",
  "G",
  "PIE",
  "RET",
  "INT",
  "RUF"
]
ignore = [
  "E111",  # conflicts with ruff format, cf doc
  "E114",  # conflicts with ruff format, cf doc
  "E117",  # conflicts with ruff format, cf doc
  "E501",  # conflicts with ruff format, cf doc
  "UP032",  # Use f-string instead of `format` call
  "UP030",  # Use implicit references for positional format fields
  "UP037",  # due to protocol using class member name same as object type we want to use quotes and precise ua namespace
  "ASYNC110",  # too many false positives
  "RET504",  # do not agree
  "RUF015",  # Not sure
]

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401", "F403"]
"examples/*" = ["F841", "E402"]
"asyncua/ua/status_codes.py" = [
  "RUF001"
]  # we get some crappy chars from spec
