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

Use explicit path in "recipe not found" exception #2249

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conda_smithy/lint_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def main(

if not os.path.exists(recipe_file):
raise OSError(
f"Feedstock has no recipe/{os.path.basename(recipe_file)}"
f'Recipe not found: {recipe_file}; did you pass the "recipe" subdirectory?'
Copy link
Member

Choose a reason for hiding this comment

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

I think there's a setting for recipe, so this shouldn't be hardcoded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, "kinda". If you aren't passing the correct directory, then we can't get the setting — and I dare say changing the name is rare enough that "recipe" will be a good hint most of the time. Perhaps it would work if I removed the quotes:

Suggested change
f'Recipe not found: {recipe_file}; did you pass the "recipe" subdirectory?'
f'Recipe not found: {recipe_file}; did you pass the recipe subdirectory?'

?

)

if build_tool == CONDA_BUILD_TOOL:
Expand Down
23 changes: 23 additions & 0 deletions news/2249-recipe-not-found-path.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* Improve the "recipe not found" exception to include the path used and a suggestion what path to pass. (#2249)

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>