python-template
python-template copied to clipboard
Decide importing
Split of #160:
We should then decide on relative imports or absolute (not sure those are the correct terms):
# the import below is in a file that is itself part of the package
from .workarounds.remove_comments_rst import remove_comments_rst
# the import below is in a file that is itself part of the package
from howfairis.workarounds.remove_comments_rst import remove_comments_rst
I think this can be closed. It is very specific for packages with a lot of substructure and shouldn't be in the template, imho. For instance, there are also packages with just one module.py
file and there are packages with just one folder (probably the majority). Apart from that, I think both styles are fine and we needn't pick one or the other. Let the people on the project decide on that.
Let's leave this up to the package developers.
We recommend following PEP8 for this: https://peps.python.org/pep-0008/#imports, so indeed there is no need to come up with our own recommendation.