mamba-org / boa

The fast conda package builder, based on mamba
https://boa-build.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
255 stars 56 forks source link

Only copy the recipe if it exists #356

Closed dhirschfeld closed 1 year ago

dhirschfeld commented 1 year ago

Resolves #355

dhirschfeld commented 1 year ago

m.meta_path points to recipe.yaml in the repo root: https://github.com/mamba-org/boa/blob/a2d5e4add7681adbd3aa63fa46e8343d3364b9b6/boa/core/recipe_handling.py#L123-L130

If you instead use a pyproject.toml file to define your packaging metadata the recipe.yaml file doesn't exist but original_recipe is set to point to this non-existent file which then causes an error when boa tries to read it: https://github.com/mamba-org/boa/blob/a2d5e4add7681adbd3aa63fa46e8343d3364b9b6/boa/core/recipe_handling.py#L149-L151

This PR simply checks for the existence of the file pointed to by m.meta_path, and if it doesn't exist it then doesn't set original_recipe.