-
Notifications
You must be signed in to change notification settings - Fork 140
Problem conditionally defined/generated objects? #264
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
Comments
Do you have a branch of pymor that's using autoapi that I can test with? I don't think the conditionals are the problem but I can't tell what the problem is from this traceback unfortunately. AutoAPI isn't capable of parsing cython modules so you will have to supply stub files for those cython modules so that AutoAPI can parse those instead. |
Sure thing:
Alright, adding stub functions to the cython dummy import files is simple enough. Thank you for looking into this! |
I've tried to understand what the problem might be by adding tests in astroid. I think I replicated the conditional definition setup at a very basic level here. I don't really understand the test setup fundamentals, but the result seems surprising to me. I had expected both cases find the same number of function definitions. That doesn't feel to relate to my problem though, since there's at least one def found either way. |
I've further tracked this down now and to me it looks like there's a problem with This commit basically adds the whole source file from pyMOR to the astroid testsuite. The test fails: https://travis-ci.com/github/renefritze/astroid/jobs/487452325#L353 The culprit seems to be the Edit: Further minimized the failure test case: renefritze/astroid@83d0422 and discovered switching the partial from pickle to something else also fixes the problem: renefritze/astroid@307f3ac |
So it looks like the referenced issue in astroid has gone away/was fixed. I do have a stripped down test case now where if I have multiple classes guarded by an "broken" HTML output So my current guess is that |
It seems conditionally defined objects are not handled correctly.
Example file
On a hunch, I've tried to avoid this with setting a
astroid.MANAGER.register_failed_import_hook
to filter, but that didn't do it.It would be nice if we could avoid this warnings, as we're currently treating warnings as errors.
Full list of warnings also suggests a similar problem for files where we have a cython extension module and a dummy import file:
Dummy import file and associated cython source
The text was updated successfully, but these errors were encountered: