Skip to content
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

Make config related paths dynamical. Fixes #3104 #3105

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

Xarthisius
Copy link
Member

PR Summary

This PR ensures that every time a "config path" is requested it respects the current value of XDG_HOME_DIR.

yt/config.py Outdated Show resolved Hide resolved
@matthewturk
Copy link
Member

Not sure if it helps, but pooch (an optional dependency for yt) depends on appdirs which abstracts this a bit.

Copy link
Member

@neutrinoceros neutrinoceros left a comment

Choose a reason for hiding this comment

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

Thank you for doing this; I left a couple notes but overall LGTM

yt/config.py Show resolved Hide resolved
from yt.testing import assert_raises, fake_random_ds

XDG_CONFIG_HOME = os.environ.get("XDG_CONFIG_HOME")
Copy link
Member

Choose a reason for hiding this comment

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

why isn't this part of the test setup ?

Copy link
Member Author

Choose a reason for hiding this comment

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

What's the difference? It's not going to be imported by anything

Copy link
Member

@neutrinoceros neutrinoceros Mar 8, 2021

Choose a reason for hiding this comment

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

You're right, but in this state it looks like it's going to be used in more than one test (which would make it a candidate for fixture in pytest), but it's not the case, so might as well define it in the only scope it used.

yt/funcs.py Outdated Show resolved Hide resolved
Sanitize conf/plugin handling in tests
@Xarthisius Xarthisius merged commit 0b7fe2b into yt-project:main Mar 10, 2021
@Xarthisius Xarthisius deleted the config_safety branch March 10, 2021 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tests: running tests Issues with the test setup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants