python-template icon indicating copy to clipboard operation
python-template copied to clipboard

Decide importing

Open fdiblen opened this issue 3 years ago • 1 comments

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

fdiblen avatar Apr 29 '21 13:04 fdiblen

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.

egpbos avatar Mar 30 '22 11:03 egpbos

Let's leave this up to the package developers.

egpbos avatar Jul 11 '23 15:07 egpbos

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.

bouweandela avatar Jul 31 '23 14:07 bouweandela