Skip to content

Decide importing #255

Closed
Closed

Description

@fdiblen

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

Activity

  1. added
    generated-package
    on Apr 29, 2021
  2. egpbos commented on Mar 30, 2022

    @egpbos
    Collaborator

    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.

  3. egpbos commented on Jul 11, 2023

    @egpbos
    Collaborator

    Let's leave this up to the package developers.

  4. bouweandela commented on Jul 31, 2023

    @bouweandela
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    generated-package

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions