pypa / pypa/packaging.python.org

Overview implies only uploading sdists for pure Python packages

Open
#539 27 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component: overview type: bug
Dominant language
Python
Stars
1.7k
Forks
1.7k
Avg merge
3d 12h
Merged PRs (30d)
4

Description

The recently added overview (which is overall pretty great), implies that for Pure Python packages, you only want to upload a sdist. While it's generally true that some of the wins are most obvious with packages that contain compiled code, pure python projects should pretty much always upload wheels as well (and for them, it's generally easier, and often times a single wheel file is all they need).

As we progress packaging forward, one thing that is for certain is that we know that we will someday be able to have PyPI present information like Requires-Dist for wheel files, allowing pip and such to resolve dependencies without downloading the files and executing a Python subprocess. We don't know that we are going to be able to do that for sdists (though of course we hope to). Projects that don't upload wheels risk, in this likely future, from forcing installers to rely on much slower mechanisms for dependency resolution.

Of course Wheels are also just generally faster to install, even for pure python projects the speed up can be 1-2s per package, which can add up greatly over even a fairly modest dependency set (30 depencies means 30-60s more time if they don't provide wheels).

This kind of throws this section of the overview off a bit, since the entire premise of this section is the gradient from single .py files, to pure python packages, to packages with compiled artifacts. That gradient is probably worth while to express, but it should have some distinction other than sdist vs wheels, because you should produce both packages, for both layers of the gradient (omitting plain .py files for obvious reasons).

Perhaps a better way to describe this gradient would be indicating the tools you use to build it? You can use something simpler like flit for pure python, whereas if you're doing something compiled you're likely going to need setuptools or numpy.distutils or something.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the recently added packaging overview section described in the issue and review its discussion for the intended distinction between pure-Python and compiled packages. Update the overview so it does not imply that pure-Python projects should upload only sdists, and make the revised gradient clear while reflecting the wheel and sdist guidance discussed here.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.