Skip to content

Add a subpackage #160

@jspaaks

Description

@jspaaks

Currently, the template doesn;t use subpackages (i.e. subdirectories to the package directory that have an __init__.pyin them). Users who want to organize their packages using subpackages currently have to update setup.cfg's packages key. There are two options for doing so:

  1. use find_packages in setup.py to automatically find all subpackages
  2. be explicit in what is in a package by adding a line for each subpackage in setup.cfg

Adding a subpackage to the automatically generated package makes it obvious how to use subpackages, and additionally offers the opportunity to have an approved style of importing. See e.g. discussion fair-software/howfairis#226.

Additionally, 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

vs.

# the import below is in a file that is itself part of the package
from howfairis.workarounds.remove_comments_rst import remove_comments_rst

Metadata

Metadata

Assignees

Labels

templateRelated to the template itself, as opposed to the generated code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions