Closed 4lm closed 1 year ago
Oh, sorry. It seems I was not clear enough. The problem is __file__
because its value depends on how you call this library and its behaviour after packaging is rather unpredictable as we had to learn the hard way
Use pkg_resources instead
Hi, @4lm @MGlauer; I'm not sure I understand the adaptation request correctly. Could one of you suggest a revision? @jh-RLI, if you do, you might as well implement it.
@MGlauer,
in our last talk you told me that you would do file imports/reads differently and that I could have a look at
omi/dialects/base/parser.py
. For me your approach in__unpack_file()
doesn't look that different from what I do. Except mine is not a function definition, and I look up the path withos.path.join(os.path.dirname(__file__)
, which IMO is not a problem, because it should give on every operating system the correct path string for the JSON file which is in the same folder as the concerning python module.@MGlauer, can you give me more hints, what you meant!