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

Improve the PackageLoader error message #1706

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

LilyFoote
Copy link
Contributor

@LilyFoote LilyFoote commented Aug 11, 2022

Explain why the PackageLoader failed when the package_path directory is missing.

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.
  • Run pre-commit hooks and fix any issues.
  • Run pytest and tox, no tests failed.

@LilyFoote
Copy link
Contributor Author

I don't think the first 4 items of the checklist are relevant here, but happy to be corrected.

@LilyFoote
Copy link
Contributor Author

@davidism Here's that PR.

LilyFoote and others added 2 commits December 19, 2024 20:02
This exception is raised when the `package_path` directory (default "templates") is not
found, so explain this.
@davidism davidism changed the base branch from main to stable December 20, 2024 04:15
@davidism davidism force-pushed the package-loader-error-message branch from f1b148d to aaa083d Compare December 20, 2024 04:15
@davidism davidism added this to the 3.1.5 milestone Dec 20, 2024
@davidism
Copy link
Member

I split this into two messages: the original if no search paths are found in the package spec, and the new one if no search path contains the templates directory. Added a test for the new message, a test for the original message will take some thought since it would be a very rare situation.

@davidism davidism merged commit 53c7591 into pallets:stable Dec 20, 2024
12 checks passed
@LilyFoote LilyFoote deleted the package-loader-error-message branch December 20, 2024 07:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error message from PackageLoader could be more helpful
3 participants