-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add MYPY_CONFIG_FILE_DIR to environment when config file is read #9403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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. |
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.test
to list of test files inmypy/test/testcmdline.py
.Added one testcase, using $MYPY_CONFIG_FILE_DIR to set
files=
in mypy.ini.