Skip to content

Packaging Python Projects tutorial doesn't work as written #584

Description

@dogweather

The instructions can't be followed verbatim for the simple reason that the suggested package name, example_pkg is already in use on TestPyPI. TestPyPI will give the (newbie, student) user this unhelpful message:

[username] cannot upload to package example_pkg.

It unhelpful because it's missing a because clause in the sentence. E.g., "... because another account owns this package name."

I saw a user go and check their account settings, password, etc., not knowing that these had nothing to do with the problem. And then if the user does intuit what the problem might be, they'd need to restart the tutorial, or maybe try editing the generated files, making a mess of things.

Currently the only hint that the tutorial isn't workable as-is is found at the end of the name attribute description, which is easy to overlook:

name is the name of your package. This can be any name as long as only contains letters, numbers, _ , and -. It also must not already taken on pypi.org.

My suggestion

We edit the tutorial to include choosing a new name for the test project, and warning that there's the possibility that they've chosen a name that already exists. And if so, what error to expect.

Secondly, the tutorial should follow suit, and use some seemingly random name in the examples, like example_pkg_blue_flowers.

Metadata

Metadata

Assignees

Labels

type: bugA confirmed bug or unintended behavior

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions