-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Streamline simple repository API specification #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EpicWink
wants to merge
35
commits into
pypa:main
Choose a base branch
from
EpicWink:simple-repo-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
653cbc6
WIP: simple repository API spec
EpicWink 4d2f865
Merge remote-tracking branch 'upstream/main' into simple-repo-api
EpicWink d99bb40
Convert history to list
EpicWink 62a3514
Add PEP 503
EpicWink 3d895a8
Link to spec for OpenAPI
EpicWink 6d057b3
Add history for requires-python
EpicWink f8d34f7
Add PEP 592
EpicWink 8f22157
More glossary linking
EpicWink 944c4f9
Add API version scheme and metadata element
EpicWink cbf3770
Add project-details HTML example
EpicWink 39c56f2
Fix spelling
EpicWink c5d962e
Fix references
EpicWink fa0788c
Add PEP 658
EpicWink 6a82b48
Remove extra space
EpicWink 381203d
Common HTML5 spec link
EpicWink c5e579a
Add core-metadata to HTML example
EpicWink 5adcc7c
Add PEP 691
EpicWink 8d727fe
Add PEP 700
EpicWink 9810653
Document files-list unordered
EpicWink 602d0b4
Hashlib references with intersphinx
EpicWink c6cec4e
Single-underscore OpenAPI spec reference
EpicWink c53b9a9
Make reference names consistent
EpicWink 2bc32e2
Fix grammar
EpicWink e016b32
Replace PEP 440 reference with guide ref
EpicWink 2154e29
Remove license from OpenAPI doc
EpicWink f6ff452
Move 'yanked' intention to footnote
EpicWink 1d3c63e
Add content-type format description as a footnote
EpicWink 62fd78e
Remove redundant adjective
EpicWink f26cb15
Use 'versionadded' directive
EpicWink ec1068a
Remove unnecessary hyphen
EpicWink 7e583aa
Fix representation-specific content-types
EpicWink f622a75
Refer to representation-specific details for core-metadata file exist…
EpicWink 2eff730
Merge remote-tracking branch 'upstream/main' into simple-repo-api
EpicWink 6c5e05f
Merge remote-tracking branch 'upstream/main' into simple-repo-api
EpicWink 3ba0284
Merge remote-tracking branch 'upstream/main' into simple-repo-api
EpicWink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
202 changes: 202 additions & 0 deletions
202
source/specifications/simple-repository-api.openapi.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
openapi: '3.1.0' | ||
|
||
info: | ||
title: Simple Repository API | ||
version: '1.1' | ||
summary: A protocol for tools to list and and download Python packages | ||
license: | ||
name: Creative Commons Attribution-ShareAlike | ||
url: https://creativecommons.org/licenses/by-sa/3.0 | ||
|
||
paths: | ||
/: | ||
get: | ||
summary: Projects list | ||
description: List all projects provided by this package index | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
text/html: | ||
schema: | ||
title: HTML response | ||
type: string | ||
application/vnd.pypi.simple.v1+html: | ||
schema: | ||
title: HTML response | ||
type: string | ||
application/vnd.pypi.simple.v1+json: | ||
schema: | ||
title: JSON response | ||
type: object | ||
required: | ||
- meta | ||
- projects | ||
properties: | ||
meta: | ||
$ref: '#/components/schemas/meta' | ||
projects: | ||
title: Projects list | ||
type: array | ||
items: | ||
title: Project reference | ||
type: object | ||
required: | ||
- name | ||
properties: | ||
name: | ||
title: Project name | ||
type: string | ||
example: | ||
meta: | ||
api-version: '1.0' | ||
projects: | ||
- name: Frob | ||
- name: spamspamspam | ||
|
||
/{project}/: | ||
parameters: | ||
- name: project | ||
in: path | ||
description: Project normalised name | ||
required: true | ||
example: numpy | ||
schema: | ||
type: string | ||
pattern: ^[a-z0-9](-?[a-z0-9])*[a-z0-9]?$ | ||
|
||
get: | ||
summary: Project details | ||
description: Some project details and all package files in the index for | ||
the project | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
text/html: | ||
schema: | ||
title: HTML response | ||
type: string | ||
application/vnd.pypi.simple.v1+html: | ||
schema: | ||
title: HTML response | ||
type: string | ||
application/vnd.pypi.simple.v1+json: | ||
schema: | ||
title: JSON response | ||
type: object | ||
required: | ||
- meta | ||
- name | ||
- files | ||
properties: | ||
meta: | ||
$ref: '#/components/schemas/meta' | ||
name: | ||
title: Project name (normalised) | ||
type: string | ||
pattern: ^[a-z0-9](-?[a-z0-9])*[a-z0-9]?$ | ||
files: | ||
title: Project package files | ||
type: array | ||
items: | ||
title: Package file details | ||
type: object | ||
required: | ||
- filename | ||
- url | ||
- hashes | ||
properties: | ||
filename: | ||
title: Package filename | ||
type: string | ||
url: | ||
title: File download URL | ||
type: string | ||
format: uri-reference | ||
hashes: | ||
$ref: '#/components/schemas/hashes' | ||
requires-python: | ||
title: Python requirement | ||
description: Value of distribution's | ||
`Requires-Python` metadata field | ||
type: string | ||
dist-info-metadata: | ||
title: Distribution metadata file details | ||
description: Indicates whether the distribution | ||
metadata file exists. This file is located at the | ||
URL equal to the package file's URL appended with | ||
`.metadata` | ||
oneOf: | ||
- title: Metadata file existence | ||
type: boolean | ||
- $ref: '#/components/schemas/hashes' | ||
gpg-sig: | ||
title: File GPG signature file existence | ||
description: Indicates whether the GPG signature | ||
file exists. This file is located at the URL equal | ||
to the package file's URL appended with `.asc` | ||
type: boolean | ||
yanked: | ||
title: Distribution yanked details | ||
description: Indicates whether the distribution has | ||
been yanked | ||
oneOf: | ||
- title: Yanked status | ||
type: boolean | ||
- title: Yanked reason | ||
type: string | ||
example: | ||
meta: | ||
api-version: '1.0' | ||
name: holygrail | ||
files: | ||
- filename: holygrail-1.0.tar.gz | ||
url: https://example.com/files/holygrail-1.0.tar.gz | ||
hashes: | ||
sha256: ... | ||
blake2b: ... | ||
requires-python: '>=3.7' | ||
yanked: Had a vulnerability | ||
- filename: holygrail-1.0-py3-none-any.whl | ||
url: https://example.com/files/holygrail-1.0-py3-none-any.whl | ||
hashes: | ||
sha256: ... | ||
blake2b: ... | ||
requires-python: '>=3.7' | ||
dist-info-metadata: true | ||
|
||
404: | ||
description: Project not known by the index | ||
|
||
components: | ||
schemas: | ||
meta: | ||
title: Response meta-details | ||
type: object | ||
properties: | ||
api-version: | ||
type: string | ||
enum: ['1.0', '1.1', '1.2'] | ||
|
||
hashes: | ||
title: File hashes | ||
type: object | ||
additionalProperties: | ||
title: Hash value | ||
description: Hexadecimal encoding of hash value | ||
type: string | ||
pattern: ^[0-9a-f]+$ | ||
propertyNames: | ||
title: Hash name | ||
description: Name of hash algorithm in `hashlib`, lower-case, | ||
preferably `sha256` | ||
pattern: ^[a-z0-9_]+$ | ||
examples: | ||
- sha256: 4e388ab32b10dc8dbc7e28144f552830adc74787c1e2c0824032078a79f227fb | ||
|
||
servers: | ||
- url: https://pypi.org/simple/ | ||
description: PyPI, the default package index used by most Python packaging | ||
tools. It runs [Warehouse](https://warehouse.pypa.io/) as the index | ||
server. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.