You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose --no-site-packages to configuration file. #7768
mypy 0.730 currently supports a --no-site-packages flag, which disables searching for PEP561 compliant packages. Unfortunately, it does not seem to be exposed via a configuration file (I did not find it in https://mypy.readthedocs.io/en/latest/config_file.html and several variations in my config file raised an unused config error).
Would it be possible this option configurable via the config file?
mypy's main.py tracks no-site-packages outside of the main Options object and uses the value to adjust some other options. But it would be simple to make it part of Options and manage it like most of the other options.
As I can see, you can define python_executable in config. So if we change https://github.com/python/mypy/blob/master/mypy/modulefinder.py#L411 to if python_executable:, the following config would work
[mypy]
python_executable=
I do not fully understand the idea behind special-opts as code could easily be rewritten to have just Options namespae, and then every option could be set in mypy.ini
@msullivan Me and a colleague are currently involved in finding out how to solve this small issue, as it is marked good-first-issue. It is expected to submit a PR next week.
Currently we found that options.py as well as the config_parser.py have to be adjusted. Is there anything more? Secondly, would you recommend adding a test of some sorts to test our code changes?
Activity
msullivan commentedon Oct 21, 2019
Yeah that is a good idea.
mypy's
main.pytracksno-site-packagesoutside of the mainOptionsobject and uses the value to adjust some other options. But it would be simple to make it part ofOptionsand manage it like most of the other options.Would you like to submit a PR?
vemel commentedon Oct 31, 2019
As I can see, you can define
python_executablein config. So if we changehttps://github.com/python/mypy/blob/master/mypy/modulefinder.py#L411toif python_executable:, the following config would workI do not fully understand the idea behind
special-optsas code could easily be rewritten to have justOptionsnamespae, and then every option could be set inmypy.inidavidzwa commentedon Mar 7, 2020
@msullivan Me and a colleague are currently involved in finding out how to solve this small issue, as it is marked good-first-issue. It is expected to submit a PR next week.
Currently we found that
options.pyas well as theconfig_parser.pyhave to be adjusted. Is there anything more? Secondly, would you recommend adding a test of some sorts to test our code changes?