Skip to content

Increasing pip's & PyPI's metadata strictness #264

@brainwane

Description

@brainwane

(Followup to discussion during packaging minisummit at PyCon North America in May 2019.)

Conda has a metadata solver. Pip and PyPI already or will soon know cases where package metadata is incorrect; how firmly/strictly should metadata correctness be enforced?

There's general agreement that strictness should be increased; the question is: how quickly and to what extent?

Issues

  1. Metadata (largely dependency) can be incorrect initially, or may become incorrect in the future as new packages are released. This can be in wheels or in the source distribution.
    a. Agreement among PyPI working group to better enforce manylinux (Donald Stufft, Dustin Ingram, EWDIII) -- see "Run auditwheel on new manylinux uploads, reject if it fails #5420" Run auditwheel on new manylinux uploads, reject if it fails pypi/warehouse#5420
    b. EWDIII - There is no technical barrier for PyPI updating its metadata. There is a non-starter on updating the package/changing the metadata.
    c. Also possibility for staged releases. This would allow composition and checks before release. (Nick + Ernest)
    d. Can metadata can be corrected by producing a new wheel or post-release? Likely not by uploading a wheel.
    e. Ability to yank packages (will not install for interval-based version specifications, but would still be available to install under exact/equality pinning) per PEP 592. New simple API change to support yanking (a la Ruby gems)
    f. Metadata should not be able to differentiate between artefact and PyPI
    • The artifact metadata is canonical; and, the metadata exposed by PyPI should never diverge
  2. Non-standards-compliant wheels tagged manylinux-*
  3. Can pip stop (if an install is going to be?) breaking existing requirements
    a. will/may require the solver

Action Items:

  1. PyPI stricter on upload, write a rollout plan
    a. Chris Wilcox said "I am going to start on a validator in pypa/validator that can be leveraged at twine/setuptools/warehouse" -- has started it -- also see twine check should guard against things not accepted by PyPI like version format twine#430 twine check should guard against things not accepted by PyPI like version format endless timeouts #430
    b. Hard fail on invalid markup with explicit description type pypi/warehouse#3285 Warehouse to start hard failing package uploads on invalid markup with explicit description type
  2. Determine the behaviour of wheel build numbers
  3. Simple API for yanking; underway
  4. Finish pip solver
  5. Warning about lack of python_requires
    a. Or could the spec/setuptools be updated to fail on this
    b. Also, can we fail when there's missing author, author_email, URL. Currently warnings on setup. (chris wilcox)
    c. For packages where no restrictions on Python version are desired, a “python_requires==*” would be satisfactory
    d. also see WIP: Add metadata validation setuptools#1562
  6. Could we explore banning old upload clients from PyPI?
    a. Yes; support needs to be added; an issue needs to be created
  7. General soft-fail support [if you opt in to compliance, we’ll block your upload; otherwise we will send you warnings] -- requires Draft release feature on main archive to allow testing a release before it goes live pypi/warehouse#726

This is meant as as a tracking issue covering the various TODOs necessary to plumb this through the parts of the toolchain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions