function-sdk-python/pyproject.toml

116 lines
2.5 KiB
TOML

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "crossplane-function-sdk-python"
description = 'The Python SDK for Crossplane composition functions'
readme = "README.md"
requires-python = ">=3.11"
license = "Apache-2.0"
keywords = []
authors = [{ name = "Crossplane Maintainers", email = "info@crossplane.io" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
]
dependencies = ["grpcio==1.*", "grpcio-reflection==1.*", "structlog==24.*"]
dynamic = ["version"]
[project.urls]
Documentation = "https://github.com/crossplane/function-sdk-python#readme"
Issues = "https://github.com/crossplane/function-sdk-python/issues"
Source = "https://github.com/crossplane/function-sdk-python"
[tool.hatch.version]
path = "crossplane/function/__version__.py"
validate-bump = false # Allow going from 0.0.0.dev0+x to 0.0.0.dev0+y.
[tool.hatch.envs.default]
type = "virtual"
path = ".venv-default"
dependencies = ["ipython==8.21.0"]
[tool.hatch.envs.generate]
type = "virtual"
detached = true
path = ".venv-generate"
dependencies = ["grpcio-tools==1.60.1"]
[tool.hatch.envs.generate.scripts]
protoc = "python -m grpc_tools.protoc --proto_path=. --python_out=. --pyi_out=. --grpc_python_out=. crossplane/function/proto/v1beta1/run_function.proto"
[tool.hatch.envs.lint]
type = "virtual"
detached = true
path = ".venv-lint"
dependencies = ["ruff==0.2.2"]
[tool.hatch.envs.lint.scripts]
check = "ruff check crossplane tests && ruff format --diff crossplane tests"
[tool.hatch.envs.test]
type = "virtual"
path = ".venv-test"
[tool.hatch.envs.test.scripts]
unit = "python -m unittest tests/*.py"
[tool.hatch.envs.docs]
type = "virtual"
path = ".venv-docs"
dependencies = ["pdoc"]
[tool.hatch.envs.docs.scripts]
generate = "pdoc -m google crossplane/function -o docs"
[tool.hatch.build.targets.wheel]
packages = ["crossplane"]
[tool.ruff]
target-version = "py311"
exclude = ["crossplane/function/proto/*"]
select = [
"A",
"ARG",
"ASYNC",
"B",
"C",
"D",
"DTZ",
"E",
"EM",
"ERA",
"F",
"FBT",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = ["ISC001"] # Ruff warns this is incompatible with ruff format.
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["D"] # Don't require docstrings for tests.
[tool.ruff.isort]
known-first-party = ["crossplane"]
[tool.ruff.lint.pydocstyle]
convention = "google"