If sharing a Python library via PyPI, so that someone else can download it with pip and import it in their code, the minimal layout that I know of is this:
+ foo
+ src
+ bar
__init__.py
baz.py
setup.py
I am ignoring the potential presence of setup.cfg, README, requirements.txt and so on. The names foo and bar are typically the same, sometimes even baz, but I'm distinguishing them here for clarity.
It is possible to remove src to reduce it further:
+ foo
+ bar
__init__.py
baz.py
setup.py
Is it possible to achieve an even smaller layout for trivial (but still useful!) libraries? A live example would be ideal, but documentation, a blog post or a working example would be more than adequate. Alternatively, a clear explanation as to why this is not achievable is also welcome.
I'm imagining something like...
+ foo
baz.py
setup.py
or the possibly insane...
+ foo
setup.py
(although my hunch is that this last is not even achievable)