I'm beginning to gather a number of Python modules and also bash scripts which contain just functions. I.e. these are all files that one doesn't run directly, they are imported/called by other scripts.
I know *how* to do most of this, e.g. I know about setting PYTHONPATH and PATH etc., what I'm looking for is some recommendations about good names and places to put things.
I have all my top level scripts (i.e. stuff called directly) in ~/bin which gets added to one's path automatically by the default .profile (at least on Ubuntu family). So ~/bin is a sort of linux default for these. What I'm looking for is, maybe, a default for python modules and other scripts.
Currently I have python modules in ~/bin/pymods and I don't have bash 'libraries' anywere.
Are there any obvious 'defaults' or should I just invent names I fancy and stop being so OCD? :-)
I would look at ubuntu-policy, debian-policy, debian-python-policy, File Heirarchy Standard and so on. I expect there are defaults (probably $HOME/lib/python and so on) which the system packages would use automatically but I do not know them by heart.
On 7 August 2018 18:09:48 CEST, Chris Green cl@isbd.net wrote:
Are there any obvious 'defaults' or should I just invent names I fancy and stop being so OCD? :-)
On Sat, Aug 11, 2018 at 12:45:38PM +0200, MJ Ray wrote:
I would look at ubuntu-policy, debian-policy, debian-python-policy, File Heirarchy Standard and so on. I expect there are defaults (probably $HOME/lib/python and so on) which the system packages would use automatically but I do not know them by heart.
Excellent idea, thank you, I sort of knew about 'policy' but it hadn't occurred to me to look for them explicitly.
On Sun, 12 Aug 2018 09:04:27 +0100 Chris Green cl@isbd.net wrote:
On Sat, Aug 11, 2018 at 12:45:38PM +0200, MJ Ray wrote:
I would look at ubuntu-policy, debian-policy, debian-python-policy, File Heirarchy Standard and so on. I expect there are defaults (probably $HOME/lib/python and so on) which the system packages would use automatically but I do not know them by heart.
Excellent idea, thank you, I sort of knew about 'policy' but it hadn't occurred to me to look for them explicitly.
Oh yes - there is an installable package called debian-policy but sometimes you have to look on the website for the subsidiary policies or the latest updates.
On Sat, Aug 11, 2018 at 12:45:38PM +0200, MJ Ray wrote:
On 7 August 2018 18:09:48 CEST, Chris Green cl@isbd.net wrote:
Are there any obvious 'defaults' or should I just invent names I fancy and stop being so OCD? :-)
I would look at ubuntu-policy, debian-policy, debian-python-policy, File Heirarchy Standard and so on. I expect there are defaults (probably $HOME/lib/python and so on) which the system packages would use automatically but I do not know them by heart.
There are some more generic policies worth looking at too; see the XDG Base Directory Specification[0] or Python's PEP 370[1] for example.
J.
[0] https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html [1] https://www.python.org/dev/peps/pep-0370/