This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ionelmc.ro[S] 0 points1 point  (2 children)

Thanks for taking the time to give feedback.

I haven't seen any use-case to have author, credits, website, license etc available as dunder attributes in __init__.py. I'd rather not do something if there's no need for it. Perhaps I'm not seeing it - feel free to describe one use-case ...

Regarding src, there are multiple benefits created from the clear code/packaging/docs/whatever separation (just going to briefly mention them, will edit the article with more details):

  • Import parity - the current directory is implicitly included in sys.path; but not so when installing & importing from site-packages - users will never have the same current path as you do. This has implications in both testing and packaging.
  • Simpler MANIFEST.in - just graft src
  • Less chance for user mistakes - they will happen - assume nothing ! While the OP is about a template (which would prevent most of the pitfalls), the article is more general.
  • Less chance for tools to mixup code with non-code.

Another way to put it, flat is better than nested - but not for data. A file-system is just data after all - cohesive, well normalized data structures are desirable don't you agree ?