We've discussed that it would be nice to tweak dcpy structure just a bit to make our repo a tad cleaner.
There are two main accepted structures for the layout of a package - src layout and flat layout. Right now, we're effectively doing a flat layout in the root folder of our repo. This isn't quite ideal - mainly, we don't like that pyproject.toml is serving many different purposes right now, and it'd be nice to have all the packaging/dependency information for dcpy within its own folder.
We briefly discussed having something like
dcpy
- pyproject.toml
- src
- models
- ...
- test
However, this has one main issue: having dcpy as both a top-level folder and the name of the package messes up pythons import search order - local folder takes priority, and now dcpy doesn't have a models submodule based solely on the folder structure
To solve this, we could rename the top-level folder - something sort of inelegant like dcpy_pkg would work. Or we could also go more the direction that the setuptools doc suggests, that you have one top-level "packages" folder that has packages within (either in src or flat layout). I still honestly don't quite love this - I sort of like this simplicity of one folder per package, with everything needed inside (as opposed to multiple packages with their own source folders, test folders, and all sharing one pyproject.toml).
We've discussed that it would be nice to tweak dcpy structure just a bit to make our repo a tad cleaner.
There are two main accepted structures for the layout of a package - src layout and flat layout. Right now, we're effectively doing a flat layout in the root folder of our repo. This isn't quite ideal - mainly, we don't like that
pyproject.toml
is serving many different purposes right now, and it'd be nice to have all the packaging/dependency information fordcpy
within its own folder.We briefly discussed having something like
However, this has one main issue: having
dcpy
as both a top-level folder and the name of the package messes up pythons import search order - local folder takes priority, and nowdcpy
doesn't have amodels
submodule based solely on the folder structureTo solve this, we could rename the top-level folder - something sort of inelegant like
dcpy_pkg
would work. Or we could also go more the direction that thesetuptools
doc suggests, that you have one top-level "packages" folder that has packages within (either in src or flat layout). I still honestly don't quite love this - I sort of like this simplicity of one folder per package, with everything needed inside (as opposed to multiple packages with their own source folders, test folders, and all sharing one pyproject.toml).