dwave-cloud-client icon indicating copy to clipboard operation
dwave-cloud-client copied to clipboard

Default Locations of dwave.conf in OS X

Open ccoffrin opened this issue 6 years ago • 7 comments

What do you think about adding ~/.config/dwave/dwave.conf as one the default locations to look for config file locations in OS X? Then there is at least one option for a standard config file location across OS X and Unix systems.

ccoffrin avatar Jun 16 '19 01:06 ccoffrin

I agree it would be nice to have consistency across platforms.

However, config paths are currently chosen in a way that should be the most natural on each platform. Also, that is delegated to our homebase library.

On Linux we use paths consistent with XDG Base Directory Specification, and I'm not sure that applies to OS X. But I'm not a Mac user, so could be convinced. :smiley:

randomir avatar Jun 17 '19 22:06 randomir

I think the current default paths are quite reasonable on a platform by platform basis. I only advocate for adding one more location to check by default, which is platform agnostic.

The env-var HOME is well defined for all platforms, so I propose that there is at least one home-relative place to put this file that is checked by default. This way, advanced users can choose to have a consistent location across multiple OSes.

ccoffrin avatar Jun 17 '19 22:06 ccoffrin

Except Windows. I don't think HOME made in there yet (although, they are now in the embracing and/or extending phase, so it's probably just a matter of time).

But I like the idea. Would you say ~/.config/dwave/dwave.conf makes sense on OS X?

Oh, there is one config file location shared on all platforms, and that's ./dwave.conf.

randomir avatar Jun 17 '19 22:06 randomir

USERPROFILE is HOME on Windows AFAK.

./dwave.conf did not fit my use case becouse it is a relative path not an absolute one. I wanted to define one global conf file for all of the computers that I can access and only keep one copy. Another advantage of the home-based bath is that it works well with networked home dirs that are mounted in multiple systems.

I am fine with ~/.config/dwave/dwave.conf on OS X. There are not strong standards on where these things live in my experience.

ccoffrin avatar Jun 17 '19 22:06 ccoffrin

There is USERPROFILE, but I'm not sure I would call it a HOME equivalent, because roaming profiles use a different base dir. Maybe that's irrelevant.

Before proceeding to add this feature, though, I have to ask -- would setting a DWAVE_CONFIG_FILE environment variable help? You can use any absolute or relative path you choose there.

randomir avatar Jun 17 '19 22:06 randomir

Good suggestion. My first choice would be to have one place I can put this file across OS X and Linux and it "just works", but if you prefer not then DWAVE_CONFIG_FILE sounds like is a viable solution for my use case.

ccoffrin avatar Jun 17 '19 23:06 ccoffrin

No, we can add it. I see os.path.expanduser("~") works on all platforms, so it shouldn't be too big of a hack.

But until we add it, it's good to know DWAVE_CONFIG_FILE works for you.

randomir avatar Jun 18 '19 00:06 randomir