G'day,
Being a total python noob when it comes to packaging and module organisation..
Given the following (simplified) structure:
.
├── bin
│ └── fos.py
└── lib
└── drac.py
And the fact, that when installed, contents of lib folder will go somewhere into /usr/local/share/pyshared and contents of bin folder somewhere in /usr/bin, how do I persuade this whole thing to import my modules from ../lib when in VCS mode and work like it should, i.e. from modulename.drac import bla when installed, while keeping imports preferably the same?
Yes, I've read python docs on module organisation and structure, I just can't seem to wrap my head around some best practices. Asking for best practices on SO is stupid, hence this concrete example, which I have on a daily basis more or less.
Is this structure acceptable, if so, how do I organise the imports? If not, what would be the pythonic way to redo it?
Thanks!
/usr/share, wherease binaries under/usr/bin. I know this might be alien to python module packaging paradigm, but python being THE tool for system administrators should have a way to package contrib "binaries" from the lib code? :) And yes, lib is separate, binary is separate, but packaging 1 python file into a separate UNIX package seems like a huge overkill.dpkgfornodeandnpmwork they are similar to what I described in my answer. They deploy the whole shebang into theliborsharefolder then symbolically link the related executables into/usr/local/bin.lsbstuff that isn't as relevant as it once was. ducks flying vegetables.