Add MYPY_CONFIG_FILE_DIR to environment when config file is read#9403
Merged
gvanrossum merged 4 commits intopython:masterfrom Sep 4, 2020
Merged
Add MYPY_CONFIG_FILE_DIR to environment when config file is read#9403gvanrossum merged 4 commits intopython:masterfrom
gvanrossum merged 4 commits intopython:masterfrom
Conversation
gvanrossum
requested changes
Sep 3, 2020
Member
gvanrossum
left a comment
There was a problem hiding this comment.
Otherwise this looks good to me.
test-data/unit/envvars.test
Outdated
| # To run just this test: | ||
| # pytest -n0 -k testEnvvar_MYPY_CONFIG_FILE_DIR | ||
| [file bogus.py] | ||
| FOO: int = 'x' |
Member
There was a problem hiding this comment.
Have you looked at the Travis-CI failure? This test fails on Python 3.5.1 because that doesn't support variable declarations. You can use type comments instead.
Member
|
Dang. The tests failed, even though they passed earlier. I don't see how my whitespace-only commit could have caused this, but I'm going to have to revert it, and then we can look into a fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #7968
The variable MYPY_CONFIG_FILE_DIR is set to the absolute path of (ADDED: the dirname of) the config file, prior to it being parsed. Existing environment-variable substitution should handle the rest.
Test Plan
Added new file
test-data/unit/envvars.testto list of test files inmypy/test/testcmdline.py.Added one testcase, using $MYPY_CONFIG_FILE_DIR to set
files=in mypy.ini.