Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hatch build #24

Merged
merged 1 commit into from
Dec 22, 2023
Merged

fix hatch build #24

merged 1 commit into from
Dec 22, 2023

Conversation

joelddiaz
Copy link
Contributor

Description of your changes

without this change, running 'hatch build' in my environment (Ubuntu LTS 22.04, with python 3.11.6 (from pyenv) with hatch 1.9.0) 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

Fixes #

I have:

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 <[email protected]>
Copy link
Collaborator

@bobh66 bobh66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@bobh66 bobh66 merged commit 1e63db2 into crossplane:main Dec 22, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants