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

Config resolution at import #3757

Open
birnbera opened this issue Oct 4, 2023 · 0 comments
Open

Config resolution at import #3757

birnbera opened this issue Oct 4, 2023 · 0 comments

Comments

@birnbera
Copy link

birnbera commented Oct 4, 2023

I'm using the Quilt API in my own code and have found testing package logic to be a challenge without polluting my default local registry. The problem comes from the fact that the default config locations are set as global variables in util.py even though they do respect platform specific envars, such as XDG_*. Thus, during testing, you can't override the registry location and/or config files for individual tests without mocking in several different places or restarting the interpreter.

One way to improve the API would be to create a Config type that could be passed to dependent types, e.g., Package. These in turn could by default use a predefined global Config object that uses the paths as currently defined, but could be overridden when necessary.

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

No branches or pull requests

1 participant