← 返回首页
PEP 243 – Module Repository Upload Mechanism | peps.python.org Following system colour scheme Selected dark colour scheme Selected light colour scheme

Python Enhancement Proposals

Toggle light / dark / auto colour theme PEP 243 – Module Repository Upload Mechanism

PEP 243 – Module Repository Upload Mechanism

Author: Sean Reifschneider <jafo-pep at tummy.com> Discussions-To: Distutils-SIG list Status: Withdrawn Type: Standards Track Topic: Packaging Created: 18-Mar-2001 Python-Version: 2.1 Post-History: 20-Mar-2001, 24-Mar-2001 Table of Contents

Abstract

For a module repository system (such as Perl’s CPAN) to be successful, it must be as easy as possible for module authors to submit their work. An obvious place for this submit to happen is in the Distutils tools after the distribution archive has been successfully created. For example, after a module author has tested their software (verifying the results of setup.py sdist), they might type setup.py sdist --submit. This would flag Distutils to submit the source distribution to the archive server for inclusion and distribution to the mirrors.

This PEP only deals with the mechanism for submitting the software distributions to the archive, and does not deal with the actual archive/catalog server.

Upload Process

The upload will include the Distutils PKG-INFO meta-data information (as specified in PEP 241), the actual software distribution, and other optional information. This information will be uploaded as a multi-part form encoded the same as a regular HTML file upload request. This form is posted using ENCTYPE="multipart/form-data" encoding (RFC 1867).

The upload will be made to the host “www.python.org” on port 80/tcp (POST http://www.python.org:80/pypi). The form will consist of the following fields:

Return Data

The status of the upload will be reported using HTTP non-standard (X-*) headers. The X-Swalow-Status header may have the following values:

Optionally, there may be a X-Swalow-Reason header which includes a human-readable string which provides more detailed information about the X-Swalow-Status.

If there is no X-Swalow-Status header, or it does not contain one of the three strings above, it should be treated as a temporary failure.

Example:

>>> f = urllib.urlopen('http://www.python.org:80/pypi') >>> s = f.headers['x-swalow-status'] >>> s = s + ': ' + f.headers.get('x-swalow-reason', '<None>') >>> print s FAILURE: Required field "distribution" missing.

Sample Form

The upload client must submit the page in the same form as Netscape Navigator version 4.76 for Linux produces when presented with the following form:

<H1>Upload file</H1> <FORM NAME="fileupload" METHOD="POST" ACTION="pypi" ENCTYPE="multipart/form-data"> <INPUT TYPE="file" NAME="distribution"><BR> <INPUT TYPE="text" NAME="distmd5sum"><BR> <INPUT TYPE="file" NAME="pkginfo"><BR> <INPUT TYPE="text" NAME="infomd5sum"><BR> <INPUT TYPE="text" NAME="platform"><BR> <INPUT TYPE="text" NAME="signature"><BR> <INPUT TYPE="hidden" NAME="protocol_version" VALUE="1"><BR> <INPUT TYPE="SUBMIT" VALUE="Upload"> </FORM>

Platforms

The following are valid os names:

aix beos debian dos freebsd hpux mac macos mandrake netbsd openbsd qnx redhat solaris suse windows yellowdog

The above include a number of different types of distributions of Linux. Because of versioning issues these must be split out, and it is expected that when it makes sense for one system to use distributions made on other similar systems, the download client will make the distinction.

Version is the official version string specified by the vendor for the particular release. For example, “2000” and “nt” (Windows), “9.04” (HP-UX), “7.0” (RedHat, Mandrake).

The following are valid architectures:

alpha hppa ix86 powerpc sparc ultrasparc

Status

I currently have a proof-of-concept client and server implemented. I plan to have the Distutils patches ready for the 2.1 release. Combined with Andrew’s PEP 241 for specifying distribution meta-data, I hope to have a platform which will allow us to gather real-world data for finalizing the catalog system for the 2.2 release.

Copyright

This document has been placed in the public domain.

Contents


Page Source (GitHub)

Source: https://github.com/python/peps/blob/main/peps/pep-0243.rst

Last modified: 2025-02-01 08:55:40 UTC