Task #2883
Updated by bizhang about 7 years ago
A content model, content serializer and content ViewSet will have been already created by https://pulp.plan.io/issues/2882 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 | |version| |metadata_version| And the following optional fields: |summary| |Description| |Keywords | |Home-page| |Download-URL| |Author| |Author-email| |Maintainer | |Maintainer-email| |License | |Classifier | |Requires-Python| |Project-URL | |platform| |download_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. [0] https://github.com/pypa/warehouse/blob/master/warehouse/packaging/models.py#L215 https://github.com/pypa/pypi-legacy/blob/master/tools/sqlite_create.py#L18 [1] https://github.com/pypa/warehouse/blob/master/warehouse/packaging/models.py#L358