Add no_site_packages setting#8524
Conversation
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.
For failing tests of python#8536
For failing tests of python#8536. For the last push I didn't take into account the result of the runtest file which is why 1 test case (for Travis )was failing.
Lint error fix where blank lines were missing / too many.
That is the point of no-site-packages, it disables mypy from searching the site-packages directory for installed packages, failing to import typedpkg is the expected result. I think you should change the expected output to be the failure to find typedpkg warning. |
For python#8536 feedback of core team leader is applied to code.
This way the source paths are ordered alphabetically which can be useful if there are many files.
|
Not to happy with the ':4' and ':2' messages in the |
5f983a3 to
1fb5baa
Compare
Sync fork
Adds main.py logic as well. Tested.
1fb5baa to
6d012af
Compare
|
@ethanhs I added a test, but I think this is not working correctly. I tried the following variants:
But all give the "testTypedPkg_nositepackages.py:6: note: Revealed type is 'builtins.tuple[builtins.str]'" note instead of an import error. I hope you can take over to find the solution. [Edit]: I also tried to add |
|
@davidzwa hm, yeah it looks like the test harness doesn't support flags like that. You can probably create a function to parse arguments and call it here and have it parse EDIT: oh and the harness will also need to understand |
|
@davidzwa you should be able to pull my changes from the You can pull the changes with something like: Let me know if you have any problems. |
|
Merged, tomorrow I will look at how to adapt test. This will not work. Any other way to build up the file? I just need to insert some escaped string, nothing fancy xD |
|
@davidzwa if you look at the test I added, you have to escape the So: should work. Let me know if it doesn't. |
|
I think I should learn to read more carefully, sorry for the miss. You'll find the the two tests sufficient, I'm sure of it! |
emmatyping
left a comment
There was a problem hiding this comment.
Awesome, thank you for working through this.
|
If you can point me to a related issue including this test-framework, that'd be awesome |
Fixes #7768
Adds main.py logic for the
no_site_packagesflag. Tested as being subjective to CLI argument (override).testpep561.pypep561.testpep561.testfileNote: run test with the following command