Skip to content

Please show me the error you're getting when trying to import my settings #1346

@colons

Description

@colons

Bug report

What's wrong

django-stubs is complaining about an import cycle, but I don't get to see it and the project otherwise runs fine.

Specifically, I get errors whenever anything accesses a settings attribute with a message like error: Import cycle from Django settings module prevents type inference for 'LOGGING' [misc].

Since I do not know what the error actually is, and there is no obvious place around the place that message is sent (transformers/settings.py) to retrieve it, I have no idea how to start fixing this.

How is that should be

I would like for there to be an option to see the full traceback of the error being alluded to here. It'd be cool if that option could be mentioned in the message about it, too.

I may be completely misunderstanding what this message means. If that's the case, I feel like it should probably be rephrased, because I'm struggling to come up with an interpretation other than "we got an ImportError accessing your settings". If that's not true, or if it's possible the error could be something other than an import cycle, the message should be changed. Either way, any additional detail about the nature of the problem would be very helpful.

If there is another bug here, I'll try to make a smaller reproducible case once I'm able to see the actual error.

System information

  • OS: linux (various)
  • python version: 3.10
  • django version: 3.2.16
  • mypy version: 0.991
  • django-stubs version: i've seen this on 1.13.2 and 1.14.0
  • django-stubs-ext version: 0.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmypy-pluginIssues specific to mypy_django_plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions