From b336926f62dc2523f1e057e09d340ebded34f74d Mon Sep 17 00:00:00 2001
From: Joel Diaz <jo.diaz@celonis.com>
Date: Wed, 20 Dec 2023 13:09:45 -0500
Subject: [PATCH] fix hatch build

without this change, running 'hatch build' in my environment (Ubuntu LTS
22.04) fails with:

  File
"/home/jo.diaz/.local/share/hatch/env/virtual/function-sdk-python/wwDZoZBv/function-sdk-python-build/lib/python3.11/site-packages/hatchling/builders/wheel.py",
line 231, in default_only_include
    return self.default_file_selection_options.only_include
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"/home/jo.diaz/.pyenv/versions/3.11.6/lib/python3.11/functools.py", line
1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File
"/home/jo.diaz/.local/share/hatch/env/virtual/function-sdk-python/wwDZoZBv/function-sdk-python-build/lib/python3.11/site-packages/hatchling/builders/wheel.py",
line 219, in default_file_selection_options
    raise ValueError(message)
ValueError: Unable to determine which files to ship inside the wheel
using the following heuristics:
https://hatch.pypa.io/latest/plugins/builder/wheel/#default-file-selection

At least one file selection option must be defined in the
`tool.hatch.build.targets.wheel` table, see:
https://hatch.pypa.io/latest/config/build/

As an example, if you intend to ship a directory named `foo` that
resides within a `src` directory located at the root of your project,
you can define the following:

[tool.hatch.build.targets.wheel]
packages = ["src/foo"]

with the change, the build succeeds

Signed-off-by: Joel Diaz <jo.diaz@celonis.com>
---
 pyproject.toml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 3c479ed..6000e71 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -62,6 +62,9 @@ path = ".venv-test"
 [tool.hatch.envs.test.scripts]
 unit = "python -m unittest tests/*.py"
 
+[tool.hatch.build.targets.wheel]
+packages = ["crossplane"]
+
 [tool.ruff]
 target-version = "py311"
 exclude = ["crossplane/function/proto/*"]