-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 'module not found' message #10569
Comments
Are there solid technical reasons for not supporting PEP 420, or it's just lack of labour? |
TBH the details are murky, I recall a very long discussion involving pytest maintainers and other members of the community (like @jaraco), and IIRC we could not arrive to a solution on how to support this in pytest. Others who remember more details and/or have links to share please do so. |
Our (for SageMath) main use of pytest would be to run doctests (in Python and in Cython). This can be done on per-file basis, in parallel (otherwise it takes many hours of wallclock time). But pytest makes it unnecessary hard to do things like |
We'd like to ask for an option to provide a package discovery hook for namespace modules/packages (e.g. in our case (our homegrown doctest system also does Python module discovery, after all). That is to say, a |
there will never be a way to monkeypatch this legacy path thing that we will remove as soon as we can as its only vendor-ed due to a need to drop pylib asap to begin with as for what to do about the discovery of homegrown doctest, thats something else pep440 awareness should help to fix most of the issues, for anything else we need to see the use-case to properly figure what api is necessary to provide |
@nicoddemus i believe the key issue is that python collection currently works in terms of files, to properly collect in namespace packages, python collection needs to be module/package/import aware as this would in general be a prerequisite for package shippable testsuites it may be a good idea to focus on "pythonic" python collection in then ext year |
in SageMath directories containing namespace packages are recognised by presence of |
Our doctests are more or less standard, and in fact |
OK, I see. Is this the place responsible for collecting tests pythonically? Line 747 in 9fbd67d
Is it stable - so that we can monkey-patch it without a fear that it'll break soon? |
No promises |
In #1567 it was men, user has spent a long time trying to figure out why their namespace package was not being found, reason being that pytest does not support namespace packages via
--pyargs
(#478).One easy suggestion is to improve the error message, from:
To something like this:
Bonus points if we link to a documentation where we have an explanation for each bullet point above.
Originally posted by @nicoddemus in #1567 (comment)
The text was updated successfully, but these errors were encountered: