Skip to content

Clarify the packaging tutorial's importable-package scope - #2147

Open
harshitethic wants to merge 1 commit into
pypa:mainfrom
harshitethic:docs/614-clarify-packaging-tutorial-scope
Open

harshitethic wants to merge 1 commit into
pypa:mainfrom
harshitethic:docs/614-clarify-packaging-tutorial-scope

Conversation

@harshitethic

@harshitethic harshitethic commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #614.

Summary

  • state that the tutorial example is an importable Python package
  • point command-line application authors to the dedicated command-line tools guidance
  • explain that an empty __init__.py does not automatically re-export add_one
  • show the correct import form and clarify that re-exporting names is an API-design choice

Validation

  • documentation-only change
  • branch is based on current upstream main

📚 Documentation preview 📚: https://python-packaging-user-guide--2147.org.readthedocs.build/en/2147/

@merwok

merwok commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

I feel that more little bits of this doc could be improved. I also wonder why the tutorial does not start with a single module before moving on to a package example. I could see people coming from other languages with namespaces (like npm or even github tight coupling like go) being unsure about what is happening here and confused between project directory and import package name!

@rgommers rgommers added type: enhancement A self-contained enhancement or new feature component: tutorials labels Nov 10, 2026

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @harshitethic.The first paragraph added looks fine, and addresses #614. The rest is duplicate, so can be removed. A single note with the cross-link is all that is needed here.

I feel that more little bits of this doc could be improved.

I agree, but that can be done separately I think. There are lots of pages that need a partial or full rewrite. Once we get rid of the large backlog of PRs (halfway there ....), then I think that's the thing to focus on.

def add_one(number):
return number + 1

Because this tutorial leaves :file:`__init__.py` empty, ``add_one`` belongs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole block seems unnecessary, please remove.

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

Labels

component: tutorials type: enhancement A self-contained enhancement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants