Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Configuration to point out a .mypy.ini #48

Open
Hi-Angel opened this issue Nov 23, 2020 · 4 comments
Open

Configuration to point out a .mypy.ini #48

Hi-Angel opened this issue Nov 23, 2020 · 4 comments

Comments

@Hi-Angel
Copy link

Hi-Angel commented Nov 23, 2020

Excuse me if it already exists, by from my searching and reading the README I come to conclusion it isn't.

The usecase I'm trying to solve is that I have a file hierarchy as follows:

my_module.py
.mypy.ini
subdir/sub_module.py

When I open sub_module.py which imports my_module.py, I get many Cannot find implementation or library stub for module named 'my_module' for all modules that are in the parent dir. As I understand, the problem comes down to pyls-mypy needing some config with the list of files, which is probably .mypy.ini. So probably some option is needed, so users could point out pyls-mypy to that configuration file.

@haplo
Copy link

haplo commented Dec 22, 2020

I'm facing the same issue, I think pyls-mypy should:

  1. Allow mypy config file to be specified in pyls config.
  2. If config is not provided try to autodetect a mypy config file relative to the file being parsed.
  3. In other cases continue as today.

I'm going to work on this, I will probably implement 2 before 1, as the valid mypy config files are well specified in their documentation: mypy.ini, .mypy.ini, setup.cfg.

@Hi-Angel
Copy link
Author

I'm facing the same issue, I think pyls-mypy should:

  1. Allow mypy config file to be specified in pyls config.
  2. If config is not provided try to autodetect a mypy config file relative to the file being parsed.
  3. In other cases continue as today.

I'm going to work on this, I will probably implement 2 before 1, as the valid mypy config files are well specified in their documentation: mypy.ini, .mypy.ini, setup.cfg.

Hi! Turned out, loading a .mypy.ini was implemented in 2019 in this PR. Unfortunately, the repo is apparently unmaintained, there's no one around to merge a PR.

@haplo
Copy link

haplo commented Dec 22, 2020

Hi! Turned out, loading a .mypy.ini was implemented in 2019 in this PR. Unfortunately, the repo is apparently unmaintained, there's no one around to merge a PR.

Thanks for letting me know! I was just getting started with this. I will take that PR as a starting point and test it locally.

@tomv564 would you have enough time for PR merges and PyPI releases? If not would you consider transferring ownership of the package in PyPI so we can issue new releases?

@asford
Copy link

asford commented Mar 13, 2021

@haplo @Hi-Angel This repo has been forked and is maintained with this feature at https://github.com/Richardk2n/mypy-ls

snejus pushed a commit to snejus/pyls-mypy that referenced this issue Mar 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants