Skip to content

Commit

Permalink
Solve issue with release
Browse files Browse the repository at this point in the history
Faced while running the following command in the CI (I was not able to reproduce this locally):
```
Run python -m build
```

Resulted in the stacktrace:
```
    val = self.func(instance)
  File "/tmp/build-env-o83v4k67/lib/python3.10/site-packages/hatchling/builders/wheel.py", line 247, 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

The most likely cause of this is that there is no directory that matches the name of your project (astronomer_cosmos).

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"]

ERROR Backend subprocess exited when trying to invoke build_wheel
```

As seen in:
https://github.com/astronomer/astronomer-cosmos/actions/runs/8986616060/job/24683237685

I confirmed this worked between releasing Cosmos 1.4.0a3 and Cosmos 1.4.0a4.

(cherry picked from commit ebbc50c)
  • Loading branch information
tatiana committed May 8, 2024
1 parent ea96f2b commit 481a6f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install build dependencies
run: python -m pip install --upgrade build
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ path = "cosmos/__init__.py"
include = ["/cosmos"]

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

######################################
# TESTING
Expand Down

0 comments on commit 481a6f1

Please sign in to comment.