Proper Importing and Packaging

Discuss API design here.
arawra
Senior Member
Posts: 190
Joined: Fri Jun 21, 2013 6:51 am

Proper Importing and Packaging

Postby arawra » Mon Aug 23, 2021 12:16 pm

I would like to know the proper way to handle importing and packaging for addons/Python.

I am taking a look at GunGame for its directory structure and the way it handles packaging. I am trying to make sense of it but a lot of the semantics seem lost on me. For instance, ../gungame/core/logging.py is imported from ../gungame/core/__init__.py as `from .logger import gg_logger`. However unlike ../gungame/core/credits.py there is no __all__ declaration. Further more in logging.py, it imports from loggers although I am unable to find loggers in a sibling directory.

I would like someone to explain to me the proper methodology of importing.

Return to “API Design”

Who is online

Users browsing this forum: No registered users and 19 guests