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

Verbose diagnostics can be improved #6544

Closed
jolaf opened this issue Mar 14, 2019 · 9 comments
Closed

Verbose diagnostics can be improved #6544

jolaf opened this issue Mar 14, 2019 · 9 comments

Comments

@jolaf
Copy link
Contributor

jolaf commented Mar 14, 2019

Even in verbose mode, mypy diagnostic output misses a lot of very useful things:

  • Path to Python interpreter that is actually being used;
  • Path to config file that is actually being used;
  • Path to cache location that is actually being used.
  • Actual path to files to check, gathered from MYPYPATH variable and config file.

Also for each file being checked, it would be useful to know:

  • Full path to the file;
  • Why mypy decided to check this particular file? Was it specified in the command line? By filename? By package name? By module name? Was it found in MYPYPATH? Was it imported by some other file? Maybe there are other ways?
  • If module is imported, was it found in the current directory? In MYPYPATH? In dist-packages of the python interpreter?
  • Is it a stub or an actual source file?

If file gets imported, but import fails, it would be extremely useful to know, why particularly.

  • Is module really not found?
  • Is module found, but stubs are not?
  • Maybe stubs were found, but they're incorrect?

I'm having serious trouble debugging my mypy configuration in CI/CD system, for example at some points mypy stops seeing my stubs I've created for a 3rd-party library I use, and than at some points starts seeing them again. The cause is eluding me for many hours, and tracking it is really difficult without detailed logging.

I understand most of my questions are silly, but I'm really having trouble finding answers to them, and by the way, verbose/debug mode IS really a way to get answers to a lot of silly questions that nobody thought somebody would ever need, but at some points someone does, isn't it?

@msullivan
Copy link
Collaborator

There are a lot of good ideas here. Would you like to submit a PR implementing some of them?

@jolaf
Copy link
Contributor Author

jolaf commented Mar 14, 2019

Hardly, for now.
I'm just starting working with mypy, writing my first stubs etc.
I know nothing about the mypy internal structure.

@jxcl
Copy link
Contributor

jxcl commented May 6, 2019

Working on this issue

jxcl added a commit to jxcl/mypy that referenced this issue May 6, 2019
jxcl added a commit to jxcl/mypy that referenced this issue May 6, 2019
jxcl added a commit to jxcl/mypy that referenced this issue May 6, 2019
@jxcl
Copy link
Contributor

jxcl commented May 6, 2019

The first section has a PR now, the other parts are harder to implement.

ilevkivskyi pushed a commit that referenced this issue May 6, 2019
akerami added a commit to davidzwa/mypy that referenced this issue Mar 13, 2020
Implementation of parts of python#6544 , namely of printing the path of the source files given to be processed by mypy. Tested using the command line as well as a configuration file.
@SwagatSBhuyan
Copy link

Is this issue still open? Some of the later suggestions may not have been implemented due to complexity. I myself am really new to the mypy repository, but I'd like to help with the later implementations. It'd really be kind of you guys to maybe nudge me in the right direction @ilevkivskyi @akerami @jxcl @jolaf
Thanks!

@ilevkivskyi
Copy link
Member

TBH I kind of lost track of what is the situation here. But other people can probably help.

@CarlFK
Copy link
Contributor

CarlFK commented Apr 26, 2023

There are 11 bullet points in the OP.
At PyCon 2023 sprint we determined some of them have been addressed.
It would be good if someone reviewed each and reported back which have been addressed and which are still outstanding.

@keshavt3
Copy link

keshavt3 commented Apr 3, 2024

I want to work on this.

@hauntsaninja
Copy link
Collaborator

Many of the things here have been addressed. Feel free to open PRs or issues for any other improvements you'd like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants