Skip to content

Clarify "Packaging Python Projects" tutorial #866

Closed

Description

@bhrutledge

First, thank you for the work to update the tutorial to use pyproject.toml, setup.cfg, and build! Looks like that was mostly related to #809.

I've been noticing what seems like an uptick in issues on https://github.com/pypa/packaging-problems/issues/, particularly related to python3 -m build. That prompted me to work through the tutorial from scratch, doing my best to keep a beginner's perspective. The outcome is a bunch of thoughts on how it could be clearer, which can be viewed as annotations to the live site (via the Hypothesis web annotation tool).

Besides a bunch of small copy-edits, there are some bigger questions about the content, e.g.

  • How much detail is necessary for the intended audience?
  • When/how should we explain "editable installs"?
  • Should this whole thing be done in a virtual environment?

Before diving into submitting a PR for any/all of these things, I'd love some feedback on my feedback. 😉

Activity

  1. added
    type: enhancement
    type: question
    on Mar 25, 2021
  2. webknjaz commented on Mar 25, 2021

    @webknjaz
    Member

    I've been noticing what seems like an uptick in issues on pypa/packaging-problems/issues, particularly related to python3 -m build. That prompted me to work through the tutorial from scratch, doing my best to keep a beginner's perspective. The outcome is a bunch of thoughts on how it could be clearer, which can be viewed as annotations to the live site (via the Hyptohesis web annotation tool).

    Thanks for the notes! Most of them seem reasonable (although, I don't think people would want to register in another service since everybody here can leave comments in PRs on GH already). I suggest you send a PR because this is where we can collaborate and add inline comments attached to the contexts of specific lines in code. I think you should start with the least controversial changes and send PRs with small batches of changes, this makes it easier for me to merge things while others wait for review. This is important because this repository is collectively maintained by a bunch of people each having tight time restrictions. I can merge unambiguous things while others would be blocked by slower reviewers.

    • How much detail is necessary for the intended audience?

    I think that tutorials shouldn't be too low-level. They need to show one way, without any branching, not to confuse new users. We probably need to keep the complex details in the follow-up guides and specific project docs.

    • When/how should we explain "editable installs"?

    I'm pretty sure it's a bit out of the scope of packaging. We could link the appropriate guides, though. Maybe add intersphinx links to the setuptools docs.

    • Should this whole thing be done in a virtual environment?

    It should IRL. But mixing up explaining venvs into packaging is probably too confusing. Also, there's an attempt to address the "don't install into system locations as root" best practice by using --user.

    cc @pradyunsg WDYT?

  3. di commented on Apr 3, 2021

    @di
    SponsorMember

    I think that tutorials shouldn't be too low-level. They need to show one way, without any branching

    +1 to this.

    @bhrutledge I'm certain your feedback is valuable, please feel free to go ahead and create a PR so we can review directly.

  4. bhrutledge commented on May 17, 2021

    @bhrutledge
    ContributorAuthor

    First batch submitted. I'll wait until those are merged before working on further changes.

  5. henryiii commented on May 21, 2021

    @henryiii
    Contributor

    FYI, some of the extra issues have been related to a few bugs in build, several of which are being fixed in the version about to be rolled out. I think the issues will slow down a little after that.

    So far the changes look great. :)

    I'm wondering if we could update to using pipx in the future? Using pipx run build, pipx run twine, etc. would help with the lack of virtual environments, and would remove some of the "set the next part up by installing this" steps.

  6. bhrutledge commented on May 21, 2021

    @bhrutledge
    ContributorAuthor

    I'm wondering if we could update to using pipx in the future? Using pipx run build, pipx run twine, etc. would help with the lack of virtual environments, and would remove some of the "set the next part up by installing this" steps.

    While I love pipx, I'm wary of introducing an additional tool, especially one that's not a PyPA project. I'd rather encourage the use of a virtual environment, which folks should already be familiar with from the Installing Packages tutorial.

  7. bhrutledge commented on May 21, 2021

    @bhrutledge
    ContributorAuthor

    So far the changes look great. :)

    Thanks! My next step is to simplify/clarify the language around setup.py and editable installs.

  8. pradyunsg commented on May 21, 2021

    @pradyunsg
    Member

    especially one that's not a PyPA project.

    That'll change in a few days: https://mail.python.org/archives/list/pypa-committers@python.org/thread/JMT66ZZHAGY3OYU26ANKOOUXV2Q2C7O6/

  9. pradyunsg commented on May 21, 2021

    @pradyunsg
    Member

    I do think it's still worthwhile to keep recommending virtual environments for now though. pipx can probably be a separate recommendation.

  10. webknjaz commented on May 22, 2021

    @webknjaz
    Member

    I'd rather not recommend pipx because we'd have to explain how to provision it on different OSs which belongs in other places. Also, I don't think we favor pipx over virtualenv.

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

    type: enhancementtype: question

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions