Source code folder structure & imports #125
Locked
damskii9992
announced in
ADRs
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
General
The source code folder structure is important both from an user-experience point-of-view, but also for a maintainability point-of-view. When source code is structured into clearly distinct modules for their distinct functionalities, and when classes aren't hidden away in files with ambiguous names, it is easier for maintainers to find files and quickly gather what the purpose of the file is just from its location.
Good use of sub-modules also makes it easier for users to import their needed classes and functions and allows us to re-name things behind the scenes and provide aliases without directly interfering with the user-experience.
Source code structure rules:
CollectionBase
,ObjectBase
,DescriptorBase
etc.__init__.py
file. Code that is no-longer maintained is put in here before it gets permanently removed later on.Import rules
__init__.py
of the module and added to the__all__
module attribute.__init__.py
, to ease user imports.Example from the
variable
sub-module:Link to the ADR suggestion:
#114
Beta Was this translation helpful? Give feedback.
All reactions