Task #2883

Updated by bizhang about 2 years ago

A content model, content serializer and content ViewSet will have been already created by

This task is to finish those classes, adding any Python specific fields.

This task will be complete when a django shell user can CRUD full representations of Python Package Releases. Packages. A REST API user should be able to read a list of all Python units `/v3/content/python/` as well as retrieve data on a specific unit (url is not yet decided).

All unit metadata is provided by the shell user at this point. It is not expected that the plugin extract the metadata from a package or scrape it from upstream.

h2. Content Model

The Pulp Content should map to a Python Release and should contain the following required fields:
|name |

And the following optional fields:
|Keywords |
|Maintainer |
|License |
|Classifier |
|Project-URL |

Each Content Unit will contain 1 or more artifacts that correspond to the Python Distribution Release (sdist, wheel, egg)

h2. Clarifications

It appears that the PyPI model keeps a copy of each of the fields in the pulp content unit separately [0] So we do not have to worry about shared fields.

In the PyPI distribution release model, no duplicate metadata copy is kept [1]. This means that if the user has a different set of metadata in the distribution release, it should not be read by Pulp; Pulp will only get the metadata from the release, and generate the artifact from the distribution release, without parsing the metadata within the distribution release.