qcs-api-client-common 0.15.0

Common code for QCS API clients
Documentation
[project]
name = "qcs-api-client-common"
requires-python = ">=3.10,<4"
version = "0.15.0"
description = "Contains core QCS client functionality and middleware implementations."
readme = "README-py.md"
license = { text = "Apache-2.0" }
authors = [
  { name = "Rigetti Computing", email = "softapps@rigetti.com" },
]
classifiers = [
  "Development Status :: 3 - Alpha",
  "License :: OSI Approved :: Apache Software License",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  "Operating System :: OS Independent",
]
dependencies = [
    "grpcio>=1.63.0",
    "grpc-interceptor>=0.15.0",
    "httpx>=0.27.0",
]

[dependency-groups]
dev = [
    "grpcio-testing >= 1.63.0",
    "pytest >= 8.1.1",
    "pytest-asyncio >= 0.23.6",
    "pytest-mock >= 3.14.0",
    "pytest-sugar >= 1.0.0",
    "pytest-clarity >= 1.0.1",
    "mypy >= 1.4.1",
    "ruff >= 0.3.5",
    "syrupy >= 4.0.0",
    "watchdog[watchmedo] >= 4.0.0",
    "maturin >= 1.5.1",
    "sphinx >= 7.3.7",
    "sphinx-autoapi >= 3.0.0",
    "furo >= 2024.5.6",
    "griffe >= 1.15.0",
    "pyo3_linter @ git+https://github.com/rigetti/rigetti-pyo3.git@feat-pyo3-linter#subdirectory=pyo3_linter",
]

[build-system]
requires = ["maturin>=1.9.4,<2.0.0"]
build-backend = "maturin"

[tool.maturin]
features = ["python"]
bindings = "pyo3"
compatibility = "linux"
sdist-include = ["README.md"]
python-source = "python"
module-name = "qcs_api_client_common._qcs_api_client_common"

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
    ".bzr",
    ".direnv",
    ".eggs",
    ".git",
    ".git-rewrite",
    ".hg",
    ".ipynb_checkpoints",
    ".mypy_cache",
    ".nox",
    ".pants.d",
    ".pyenv",
    ".pytest_cache",
    ".pytype",
    ".ruff_cache",
    ".svn",
    ".tox",
    ".venv",
    ".vscode",
    "__pypackages__",
    "_build",
    "buck-out",
    "build",
    "docs",
    "dist",
    "node_modules",
    "site-packages",
    "venv",
    # Ignore our generated type stub files.
    "python/qcs_api_client_common/**/*.pyi",
    "python/qcs_api_client_common/__init__.py",
]
line-length = 120
indent-width = 4
target-version = "py310"

[tool.ruff.lint]
select = ["D", "E4", "E7", "E9", "F", "I", "B", "S", "UP", "W"]
ignore = []
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.lint.per-file-ignores]
"tests_py/**/*.py" = [
    "D",    # docstrings are not enforced in tests
    "S101", # asserts are allowed in tests
    "S105", # hardcoded test passwords are o.k.
]
"python/qcs_api_client_common/**/*.pyi" = [
    "B008"  # In type hints, a function call in a default argument serves as documentation, and doesn't cause a bug.
]
# The module initialization script does some special tricks
# to expose the rest of the package properly in a way users would expect to import it,
# and so it's fine that it uses `assert` and `exec` to do so.
"python/qcs_api_client_common/__init__.py" = [ "S101", "S102" ]

[tool.ruff.format]
# Like Black,  use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.pyright]
# This diagnostic is raised when a type stub is found without a corresponding source file. This is
# necessarily the case for a pure Rust pyo3 module, so disabling it.
reportMissingModuleSource = false

[[tool.mypy.overrides]]
module = [
    "qcs_api_client_common.*",
    "grpc.*",
]
ignore_missing_imports = true
disable_error_code = [
    "import-untyped"
]

[tool.pytest.ini_options]
markers = [
    "integration: mark a test as an integration test.",
]
filterwarnings = [
    "ignore::DeprecationWarning::",
]