Skip to content

Fix regression for user config files #18656

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

Merged
merged 2 commits into from
Feb 12, 2025

Conversation

hauntsaninja
Copy link
Collaborator

Fixes #18650

Slightly annoying to add a test for since it would clutter up user home directory

This comment has been minimized.

@@ -276,7 +276,7 @@ def _find_config_file(
break
current_dir = parent_dir

for config_file in defaults.USER_CONFIG_FILES:
for config_file in map(os.path.expanduser, defaults.USER_CONFIG_FILES):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to expand here and not early in defaults.py?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point, if the original code had done that the bug would never have happened :-)

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

django-stubs (https://github.com./typeddjango/django-stubs): 1.97x faster (49.0s -> 24.9s in a single noisy sample)

@hauntsaninja hauntsaninja merged commit 44f82ef into python:master Feb 12, 2025
18 checks passed
@hauntsaninja hauntsaninja deleted the home-config branch February 12, 2025 06:14
ericmarkmartin pushed a commit to ericmarkmartin/mypy that referenced this pull request Feb 19, 2025
Fixes python#18650

Slightly annoying to add a test for since it would clutter up user home
directory
ericmarkmartin pushed a commit to ericmarkmartin/mypy that referenced this pull request Feb 19, 2025
Fixes python#18650

Slightly annoying to add a test for since it would clutter up user home
directory
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Fixes python#18650

Slightly annoying to add a test for since it would clutter up user home
directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.15 regression] mypy does not use $HOME/.mypy.ini, if .git directory exists
2 participants