ticoneva / pystata-kernel

Jupyter kernel for Stata based on pystata
GNU General Public License v3.0
13 stars 6 forks source link

Config file created by install --prefix will not be read in by config.py #25

Open hugetim opened 1 year ago

hugetim commented 1 year ago

If the install script is run for a custom prefix (with --prefix), the config file path used by the install script is [prefix]/etc/pystata-kernel.conf. But then when the kernel is run and 'config.py' looks for a config file, it doesn't know what that custom prefix was. 'config.py' is only able to look in sys.prefix and the user's home directory. So there is no way for a config file saved to a custom prefix to be loaded, right?

ticoneva commented 1 year ago

That's true indeed. This part of the code is based onstata_kernel, which does not create any global configuration file. The easy solution would be to ignore --prefix and place the global configuration file in sys.prefix/etc. What do you think?

hugetim commented 1 year ago

Ok, thanks. Yes, that's what I ended up doing for now with 'nbstata'. But I was a little concerned that that wouldn't suffice for someone who needs --prefix. Do you use --prefix for your use case?

ticoneva commented 7 months ago

Version 0.3.2 no longer install a configuration file in the custom prefix directory.