[14:45] Eickmeyer: more on the path to module use... [14:47] studio-controls might be installed in /usr/local/ [14:48] but the path to modules does not include that [14:50] The only thing I can think of that would deal with this is to put the import statement in main() after we figure out the install path and add the directory our module sits in to sys.path [16:33] OvenWerk1: /usr/local = BAD. That's completely against Debian packaging rules. [16:34] We simply can't do that. [16:34] Eickmeyer: I am not packaging... for any directory :) but if someone chooses to make install they can install in local [16:35] Sure, that's fine. [16:35] (or opt) [16:35] Again, ew. :) [16:37] The problem becomes that a module would be installed in that directory space and python would not normally look there for it. [16:38] (this may not be totally true, python may detect being run in local and change it's sys.path) [16:40] It would also be nice to be able to test my code "in place" in my development directory tree [16:46] Python has paths much like bash, so you can install a python module in the usual spot and it should get picked-up. [16:47] Yes, in /usr/lib but sys.path does not include /usr/local/lib [16:48] I could put the module in {prefix}/bin [16:48] but that is not nice either [16:48] (but it is how I am testing) [16:49] Makes sense, but I"m just worried about reproducibility. [16:50] I already detect where we are run from to get install_directory [16:51] I use that to findout where */share is [16:52] So I can add install_directory/lib/python3/packages (or whatever) to sys.path [16:53] but that would mean: [16:53] import sys [16:54] add runpath/etc to sys.path then import auto_jack [16:54] I've seen that line a lot in Python, so I think that'd be safe. [16:54] Eickmeyer: can you show me an example? [16:54] I wish I could, but I don't even know where to look, and I have to take my son to school now. [16:55] I would like to use "best practice" [16:55] ok [16:55] (we have no school today) [16:55] it being good friday [17:02] hmm, stackoverflow is working again with no login. [18:03] Eickmeyer: when you get back... I am using: [18:04] install_path = os.path.abspath(f"{sys.path[0]}/..") [18:04] sys.path.insert(1,f"{install_path}/lib/python3/dist-packages") [18:04] import auto_jack [18:06] This works fine in my development directory tree and of course effectively does nothing when packaged ;) but will also work for someone doing make install into local [18:08] Googling and searching basically shows that no one agrees on a "right" way to do this. But most of the people who don't like this particular method are people who expect packages (in which case I wouldn't need any of this) [18:19] OvenWerk1: Yeah, Debian has basically taken the stance of "stay the **** out of /usr/local when packaging". [18:20] I agree. There are still people who like to build/install local stuff in local [18:21] controls is an application outside of packaging too and so has to take these tings into account [18:24] Then /opt/ is really the old flatpack/snap and as such I can ignore it... so you ew for opt applies equally well to snap and flatpack :P [18:25] Yeah. /opt/ is a "stay out of" as well. [18:27] I am pretty happy so far as I have a module with one def in it that just prints some text and works as it should so I can move on to populating it something real. I think the first thing is to move the whole of convert into it so convert does not need a system call. [18:30] This has been a theme in the past few updates of controls...