[build-system] requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" [project] name = "function-template-python" description = 'A composition function' 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 = [ # TODO(negz): Push to PyPI instead. We're currently waiting on our request # for a new PyPI org for Crossplane to be approved. Once we're using a PyPI # package (e.g. a wheel), confirm that run_function_pb2.pyi is installed. This # interface file makes working with RunFunctionRequest and RunFunctionResponse # a lot easier, since it contains all the type metadata. "function-sdk-python @ git+https://github.com/crossplane/function-sdk-python", # Pin at least the things we import directly. "click==8.1.7", "grpcio==1.60.0", "protobuf==4.25.1", ] dynamic = ["version"] [project.urls] Documentation = "https://github.com/crossplane/function-template-python#readme" Issues = "https://github.com/crossplane/function-template-python/issues" Source = "https://github.com/crossplane/function-template-python" [project.scripts] function = "function.main:cli" [tool.hatch.build.targets.wheel] packages = ["function"] [tool.hatch.version] source = "vcs" [tool.hatch.metadata] allow-direct-references = true [tool.hatch.envs.default] type = "virtual" path = ".venv-default" dependencies = ["ipython==8.19.0"] [tool.hatch.envs.lint] type = "virtual" detached = true path = ".venv-lint" dependencies = ["ruff==0.1.11"] [tool.hatch.envs.lint.scripts] check = "ruff check function tests && ruff format --diff function tests" [tool.hatch.envs.test] type = "virtual" path = ".venv-test" [tool.hatch.envs.test.scripts] unit = "python -m unittest tests/*.py" [tool.ruff] target-version = "py311" exclude = ["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 = ["function"] [tool.ruff.lint.pydocstyle] convention = "google" [tool.ruff.lint.pep8-naming] # gRPC requires this PascalCase function name. extend-ignore-names = ["RunFunction"]