I’m currently trying to create a package for my python project GitHub - ZerataX/matrix-registration: a token based matrix registration api
And creating an expression to install this package is fairly simple, except for
the data_file
option in setup.py
to ship a sample configuration file.
My python project later reads from this sample file if no configuration is found.
Usually with others distros I just looked at what python gave me with sys.prefix()
or just __location__
but nix puts this file here:
/nix/store/xxxxxxxxx-python3.7-matrix-registration-0.5.6/config/config.sample.yaml
And I’m wondering if there is a smart way for me to find this place from my python application, instead of doing something like
__location__ + "../../../config/config.sample.yaml"
Furthermore I would like to develop a module to configure this package later. So my second question would be if this location where the sample config is currently put is also a good place to put the final configuration file that I would create with my module?