Skip to content

~ is not working in mypy.ini/cache_dir #6508

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

Closed
jolaf opened this issue Mar 5, 2019 · 8 comments
Closed

~ is not working in mypy.ini/cache_dir #6508

jolaf opened this issue Mar 5, 2019 · 8 comments

Comments

@jolaf
Copy link
Contributor

jolaf commented Mar 5, 2019

I'd like to create a unified mypy cache for all my projects and store it in my home directory.

Moreover, I'd like other developers, as well as CI scripts, to do the same - storing cache in THEIR home directories on their local machines.

For that, I specify in mypy.ini:

[mypy]
cache_dir=~/.mypy_cache

But that's not working as mypy creates directory ~ in the current directory instead of creating .mypy_cache in my home directory.

I'm using mypy 0.670 from pip on Ubuntu.

@gvanrossum
Copy link
Member

This seems a simple enough fix. Can you try your hand at sending us a PR?

@jolaf
Copy link
Contributor Author

jolaf commented Mar 6, 2019

Unfortunately, I couldn't find the clear place in the code to easily fix this.

@jolaf
Copy link
Contributor Author

jolaf commented Apr 10, 2019

Thank you very much!!

@weilbith
Copy link

The documentation states to support home (I guess this means ~) and environment variables. But the code only expands the ~. So instead of only calling os.path.expanduser(), I would also expect a os.path.expandvars() call. This would be really neat, since then I can use $XDG_CACHE_HOME/mypy.

@ilevkivskyi
Copy link
Member

@weilbith What do you mean by "would be", this was already added several weeks ago https://github.com/python/mypy/blob/master/mypy/config_parser.py#L42, why are you pointing to a 5-month old code in someones fork?

@weilbith
Copy link

weilbith commented Aug 14, 2019

Okay my fault. Should researches this better. Apparently this does not work for me. ☹️ Have to checkout why not in more detail. Sry for this useless comment. 🙏

@weilbith
Copy link

Okay, just because the most recent version is from Jul 12 and this has been just implemented 15 days ago.

@ilevkivskyi
Copy link
Member

The next release will happen soon (likely this month or early September).

@python python deleted a comment from revmischa Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants